Convenience class to load and validate a Data Definition xml string.
More...
|
static dd::DataDefinition | fromXMLString (const std::string &xml_string, const dd::Version &ddl_language_version=dd::Version(0, 0), bool strict=false) |
| Read a string containing a data definiton in XML. More...
|
|
static dd::DataDefinition | fromXMLString (const std::string &struct_name, const std::string &xml_string, const dd::Version &ddl_language_version=dd::Version(0, 0), bool strict=false) |
| Read a string containing a data definiton in XML. More...
|
|
static dd::DataDefinition | fromXMLString (const std::string &xml_string, dd::DataDefinition base_dd, const dd::Version &ddl_language_version=dd::Version(0, 0), bool strict=false) |
| Read a string containing a data definiton in XML and immediatelly merge it with base_dd before validating. More...
|
|
static std::string | toXMLString (const dd::DataDefinition &dd_to_write) |
| This will write the given valid Data Definiton into a string as xml. More...
|
|
static std::string | toXMLString (const dd::DataDefinition &dd_to_write, const a_util::SortingOrder order) |
| This will write the given valid Data Definiton into a string as xml. More...
|
|
static std::string | toXMLString (const std::string &struct_name, const dd::DataDefinition &dd_to_write) |
| This will write the given valid Data Definiton into a string as xml, but only vith all depending Definition of the StructType with the name struct_name . More...
|
|
static std::string | toXMLString (const std::string &struct_name, const dd::DataDefinition &dd_to_write, const a_util::SortingOrder order) |
| This will write the given valid Data Definiton into a string as xml, but only vith all depending Definition of the StructType with the name struct_name . More...
|
|
Convenience class to load and validate a Data Definition xml string.
This implementation can be used as follows:
"<struct name=\"mystruct\" version=\"1\"></struct>");
static dd::DataDefinition fromXMLString(const std::string &xml_string, const dd::Version &ddl_language_version=dd::Version(0, 0), bool strict=false)
Read a string containing a data definiton in XML.
- See also
- DDString::fromXMLString, DDString::toXMLString
Definition at line 45 of file ddstring.h.
◆ fromXMLString() [1/3]
Read a string containing a data definiton in XML.
- Parameters
-
struct_name | The data definition will determine if the struct_name extists or not. |
xml_string | The data definition may contain a fully XML defined or parts of it. (struct tag only, structs tag only, datatype only ... etc. but valid!) |
ddl_language_version | if not set the parser will have a look, if the xml_string contains a header or it guesses. |
strict | set to true to load the datamodel exactly like defined (no mixture of DDL tag definitions allowed). |
- See also
- ddl::dd::Version::getLatestVersion), but the parser will detect the "struct" layout and will set the "ddl_version" of the struct!
You may force a version with the help of ddl_language_version
, which is taken into account if no header and so no ddl version is set within the string.
- Exceptions
-
ddl::dd::Error | if the xml string is not valid against the xsd definition! (depending on the DDL Version). |
ddl::dd::Error | if the validation level of the created DataDefinition is not at least good_enough! |
ddl::dd::Error | if the given struct_name is not part of this description. |
- Returns
- dd::DataDefinition the valid Data Definiton of the string.
◆ fromXMLString() [2/3]
Read a string containing a data definiton in XML.
- Parameters
-
xml_string | The data definition may contain a fully XML defined or parts of it. (struct tag only, structs tag only, datatype only ... etc. but valid!) |
ddl_language_version | if not set the parser will have a look, if the xml_string contains a header or it guesses. |
strict | set to true to load the datamodel exactly like defined (no mixture of DDL tag definitions allowed). |
- See also
- ddl::dd::Version::getLatestVersion), but the parser will detect the "struct" layout and will set the "ddl_version" of the struct!
You may force a version with the help of ddl_language_version
, which is taken into account if no header and so no ddl version is set within the string.
- Exceptions
-
ddl::dd::Error | if the xml string is not valid against the xsd definition! (depending on the DDL Version). |
ddl::dd::Error | if the validation level of the created DataDefinition is not at least good_enough! |
- Returns
- dd::DataDefinition the valid Data Definiton of the string.
◆ fromXMLString() [3/3]
Read a string containing a data definiton in XML and immediatelly merge it with base_dd before validating.
- Parameters
-
xml_string | The data definition may contain a fully XML defined or parts of it. (struct tag only, structs tag only, datatype only ... etc. but valid!) |
base_dd | valid base ddl to merge the new parsed xml_string with. |
ddl_language_version | if not set the parser will have a look, if the xml_string contains a header or it guesses. |
strict | set to true to load the datamodel exactly like defined (no mixture of DDL tag definitions allowed). |
- See also
- ddl::dd::Version::getLatestVersion), but the parser will detect the "struct" layout and will set the "ddl_version" of the struct!
You may force a version with the help of ddl_language_version
, which is taken into account if no header and so no ddl version is set within the string.
- Exceptions
-
ddl::dd::Error | if the xml string is not valid against the xsd definition! (depending on the DDL Version). |
ddl::dd::Error | if the validation level of the created DataDefinition is not at least good_enough! |
ddl::dd::Error | if the given base_dd is not valid with at least validation level good_enough! |
- Returns
- dd::DataDefinition the valid Data Definiton of the string.
◆ toXMLString() [1/4]
This will write the given valid Data Definiton into a string as xml.
- Parameters
-
dd_to_write | the DataDefinition to write into a string. |
- Returns
- std::string the string of the DataDefinition as xml.
◆ toXMLString() [2/4]
This will write the given valid Data Definiton into a string as xml.
- Parameters
-
dd_to_write | the DataDefinition to write into a string. |
order | Sort elements in resulting string in either ascending or descending order. |
- Returns
- std::string the string of the DataDefinition as xml.
◆ toXMLString() [3/4]
static std::string toXMLString |
( |
const std::string & |
struct_name, |
|
|
const dd::DataDefinition & |
dd_to_write |
|
) |
| |
|
static |
This will write the given valid Data Definiton into a string as xml, but only vith all depending Definition of the StructType with the name struct_name
.
- Parameters
-
struct_name | name of the struct that is written into the string. |
dd_to_write | the DataDefinition where a StructType with the name struct_name is defined. |
- Returns
- std::string the string of the DataDefinition as xml.
◆ toXMLString() [4/4]
This will write the given valid Data Definiton into a string as xml, but only vith all depending Definition of the StructType with the name struct_name
.
- Parameters
-
struct_name | name of the struct that is written into the string. |
dd_to_write | the DataDefinition where a StructType with the name struct_name is defined. |
order | Sort elements in resulting string in either ascending or descending order. |
- Returns
- std::string the string of the DataDefinition as xml.