Convenience class to load and validate a Data Definition form a xml file string.
More...
Convenience class to load and validate a Data Definition form a xml file string.
This implementation can be used as follows:
static dd::DataDefinition fromXMLFile(const std::string &xml_filepath, bool strict=false)
Read a file containing a data definiton in XML.
- See also
- DDString::fromXMLString, DDString::toXMLString
Definition at line 38 of file ddfile.h.
◆ fromXMLFile() [1/2]
static dd::DataDefinition fromXMLFile |
( |
const std::string & |
xml_filepath, |
|
|
bool |
strict = false |
|
) |
| |
|
static |
Read a file containing a data definiton in XML.
- Parameters
-
xml_filepath | a valid filesystem path for loading a DataDefinition xmlfile. |
strict | set to true to load the datamodel exactly like defined (no mixture of DDL tag definitions allowed). |
- Exceptions
-
ddl::dd::Error | if the xml file 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 file.
◆ fromXMLFile() [2/2]
Read a file containing a data definiton in XML and merge it with an existing definition.
- Parameters
-
xml_filepath | a valid filesystem path for loading a DataDefinition xmlfile. |
base_dd | valid base ddl to merge the new parsed file with. |
strict | set to true to load the datamodel exactly like defined (no mixture of DDL tag definitions allowed). |
- Exceptions
-
ddl::dd::Error | if the xml file 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 file.
◆ toXMLFile() [1/2]
static void toXMLFile |
( |
const dd::DataDefinition & |
ddl_to_write, |
|
|
const std::string & |
xml_filepath |
|
) |
| |
|
static |
Writes DataDefinition to a file containing a data definiton in XML.
- Parameters
-
xml_filepath | a valid filesystem path for loading a DataDefinition xmlfile. |
ddl_to_write | a valid DataDefinition for writing a xmlfile. |
- Exceptions
-
◆ toXMLFile() [2/2]
Writes sorted DataDefinition to a file containing a data definiton in XML.
- Parameters
-
xml_filepath | a valid filesystem path for loading a DataDefinition xmlfile. |
ddl_to_write | a valid DataDefinition for writing a xmlfile. |
- Exceptions
-
- Parameters
-
[in] | order | Sort elements in description file in either ascending or descending order. |