Convenience class to load and validate a Data Definition form a xml file string.
This implementation can be used as follows:
More...
#include <ddfile.h>
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
◆ fromXMLFile() [1/2]
| static dd::DataDefinition ddl::DDFile::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
-
- 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 ddl::DDFile::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
-
- Exceptions
-
◆ toXMLFile() [2/2]
Writes sorted DataDefinition to a file containing a data definiton in XML.
- Parameters
-
- Exceptions
-
- Parameters
-
| [in] | order | Sort elements in description file in either ascending or descending order. |
The documentation for this class was generated from the following file: