ADTF
Loading...
Searching...
No Matches
ddl::mapping::MappingString Class Reference

Convenience class to load and validate a MappingConfiguration from a xml string.
This implementation can be used as follows: More...

#include <mapping_string.h>

Static Public Member Functions

static MappingConfiguration fromXMLString (const std::string &xml_string)
 Read a string containing a MappingConfiguration in a XML string.
 
static std::string toXMLString (const MappingConfiguration &config_to_write)
 This will write the given valid MappingConfiguration into a string as xml.
 

Detailed Description

Convenience class to load and validate a MappingConfiguration from a xml string.
This implementation can be used as follows:

// read the whole string and provide the contained DDL
// if there are validation errors, see @ref ddl::mapping::Error::problems
auto my_config_1 = MappingString::fromXMLString("<mapping> <!-- ... --> </mapping>");
static MappingConfiguration fromXMLString(const std::string &xml_string)
Read a string containing a MappingConfiguration in a XML string.
See also
MappingString::fromXMLString, MappingString::toXMLString

Member Function Documentation

◆ fromXMLString()

static MappingConfiguration ddl::mapping::MappingString::fromXMLString ( const std::string & xml_string)
static

Read a string containing a MappingConfiguration in a XML string.

Parameters
xml_stringThe xml string to read.
Returns
MappingConfiguration the valid MappingConfiguration of the xml string.
Exceptions
ddl::mapping::Errorif the xml string is not valid against the xsd definition! (depending on the Mapping Version).
ddl::mapping::Errorif the validation level of the created MappingConfiguration is not at least good_enough!

◆ toXMLString()

static std::string ddl::mapping::MappingString::toXMLString ( const MappingConfiguration & config_to_write)
static

This will write the given valid MappingConfiguration into a string as xml.

Parameters
config_to_writethe MappingConfiguration to write into a string.
Returns
std::string the string of the MappingConfiguration as xml
Exceptions
ddl::mapping::Errorif the validation level of the created MappingConfiguration is not at least good_enough!

The documentation for this class was generated from the following file: