10 #ifndef CPROVER_UTIL_XML_H 11 #define CPROVER_UTIL_XML_H 24 explicit xmlt(
const std::string &_name):
name(_name)
35 elementst::const_iterator
find(
const std::string &name)
const;
36 elementst::iterator
find(
const std::string &name);
39 const std::string &attribute,
43 const std::string &attribute,
47 const std::string &attribute,
48 unsigned long long value);
51 const std::string &attribute,
52 const std::string &value);
55 const std::string &attribute)
const 57 attributest::const_iterator i=attributes.find(attribute);
58 if(i!=attributes.end())
64 const std::string &attribute,
72 attributest::const_iterator i=attributes.find(attribute);
73 if(i!=attributes.end())
74 return (i->second==
"true");
80 elementst::const_iterator i=
find(element);
88 elements.push_back(
xmlt());
90 return elements.back();
95 elements.push_back(xml);
96 return elements.back();
101 elements.push_back(
xmlt());
102 return elements.back();
110 unsigned indent=0)
const;
112 static void escape(
const std::string &s, std::ostream &out);
113 static std::string
unescape(
const std::string &s);
131 #endif // CPROVER_UTIL_XML_H void set_attribute_bool(const std::string &attribute, bool value)
std::string get_element(const std::string &element) const
elementst::const_iterator find(const std::string &name) const
std::list< xmlt > elementst
xmlt(const std::string &_name)
xmlt xml(const source_locationt &location)
std::string get_attribute(const std::string &attribute) const
xmlt & new_element(const xmlt &xml)
void set_attribute(const std::string &attribute, unsigned value)
std::map< std::string, std::string > attributest
static std::string unescape(const std::string &s)
takes a string and unescapes any xml style escaped symbols
static void escape(const std::string &s, std::ostream &out)
escaping for XML elements
xmlt & new_element(const std::string &name)
bool get_attribute_bool(const std::string &attribute) const
std::ostream & operator<<(std::ostream &out, const xmlt &xml)
static void do_indent(std::ostream &out, unsigned indent)
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 ...
void output(std::ostream &out, unsigned indent=0) const