CBMC
xml.cpp File Reference
#include "xml.h"
#include <ostream>
#include "exception_utils.h"
#include "string2int.h"
#include "structured_data.h"
+ Include dependency graph for xml.cpp:

Go to the source code of this file.

Functions

bool operator== (const xmlt &a, const xmlt &b)
 
bool operator!= (const xmlt &a, const xmlt &b)
 
xmlt xml_node (const std::pair< labelt, structured_data_entryt > &entry)
 
xmlt to_xml (const structured_datat &data)
 Convert the structured_datat into an xml object. More...
 

Function Documentation

◆ operator!=()

bool operator!= ( const xmlt a,
const xmlt b 
)

Definition at line 280 of file xml.cpp.

◆ operator==()

bool operator== ( const xmlt a,
const xmlt b 
)

Definition at line 275 of file xml.cpp.

◆ to_xml()

xmlt to_xml ( const structured_datat data)

Convert the structured_datat into an xml object.

For example, the structured data: structured_datat data{ {{labelt{{"my", "data"}}, structured_data_entryt::entry( {{labelt{{"my", "number"}}, structured_data_entryt::data_node(json_numbert("10"))}, {labelt{{"my", "string"}}, structured_data_entryt::data_node(json_stringt("hi"))}})}}};

Will produce:

<my-data>
<my-number>10</my-number>
<my-string>hi</my-string>
</my-data>
Parameters
dataThe structured data to convert.
Returns
The XML object as specified.

Definition at line 303 of file xml.cpp.

◆ xml_node()

xmlt xml_node ( const std::pair< labelt, structured_data_entryt > &  entry)

Definition at line 285 of file xml.cpp.