10 #ifndef CPROVER_UTIL_XML_H
11 #define CPROVER_UTIL_XML_H
26 explicit xmlt(
const std::string &_name):
name(_name)
33 :
name(std::move(_name)),
44 elementst::const_iterator
find(
const std::string &key)
const;
45 elementst::iterator
find(
const std::string &key);
48 const std::string &attribute,
52 const std::string &attribute,
56 const std::string &attribute,
57 unsigned long long value);
60 const std::string &attribute,
61 const std::string &value);
64 const std::string &attribute)
const
66 attributest::const_iterator i=
attributes.find(attribute);
73 const std::string &attribute,
81 attributest::const_iterator i=
attributes.find(attribute);
83 return (i->second==
"true");
89 elementst::const_iterator i=
find(element);
119 unsigned indent=0)
const;
121 static void escape(
const std::string &s, std::ostream &out);
122 static std::string
unescape(
const std::string &s);
A way of representing nested key/value data.
bool get_attribute_bool(const std::string &attribute) const
xmlt(const std::string &_name)
std::string get_attribute(const std::string &attribute) const
xmlt(std::string &&_name, attributest &&_attributes, elementst &&_elements)
std::map< std::string, std::string > attributest
std::list< xmlt > elementst
static std::string unescape(const std::string &s)
takes a string and unescapes any xml style escaped symbols
void set_attribute_bool(const std::string &attribute, bool value)
xmlt & new_element(const xmlt &xml)
void set_attribute(const std::string &attribute, unsigned value)
xmlt & new_element(const std::string &key)
std::string get_element(const std::string &element) const
static bool is_printable_xml(const std::string &s)
Determine whether s does not contain any characters that cannot be escaped in XML 1....
elementst::const_iterator find(const std::string &key) const
void output(std::ostream &out, unsigned indent=0) const
static void escape(const std::string &s, std::ostream &out)
escaping for XML elements
static void escape_attribute(const std::string &s, std::ostream &out)
escaping for XML attributes, assuming that double quotes " are used consistently, not single quotes
static void do_indent(std::ostream &out, unsigned indent)
xmlt xml(const irep_idt &property_id, const property_infot &property_info)
xmlt to_xml(const structured_datat &data)
Convert the structured_datat into an xml object.
bool operator==(const xmlt &a, const xmlt &b)
std::ostream & operator<<(std::ostream &out, const xmlt &xml)
bool operator!=(const xmlt &a, const xmlt &b)