70 element.output(out, indent+2);
75 out <<
'<' <<
'/' <<
name <<
'>' <<
"\n";
81 for(
const auto ch : s)
106 out <<
"&#" << std::to_string((
unsigned char)
ch) <<
';';
111 static_cast<unsigned char>(
ch) >= 32u,
112 "XML does not support escaping non-printable character " +
113 std::to_string((
unsigned char)
ch));
123 for(
const auto ch : s)
147 out <<
"&#" << std::to_string((
unsigned char)
ch) <<
';';
152 static_cast<unsigned char>(
ch) >= 32u,
153 "XML does not support escaping non-printable character " +
154 std::to_string((
unsigned char)
ch));
162 for(
const auto ch : s)
164 if(
ch < 0x20 &&
ch != 0x9 &&
ch != 0xA &&
ch != 0xD)
173 out << std::string(indent,
' ');
178 for(elementst::const_iterator it=
elements.begin();
189 for(elementst::iterator it=
elements.begin();
214 unsigned long long value)
221 const std::string &value)
223 if((value[0]==
'\"' && value[value.size()-1]==
'\"') ||
224 (value[0]==
'\'' && value[value.size()-1]==
'\''))
241 result.reserve(str.size());
243 for(std::string::const_iterator it=str.begin();
252 while(it!=str.end() && *it!=
';')
261 else if(
tmp[0]==
'#' &&
tmp[1]!=
'x')
277 return a.name ==
b.name &&
a.data ==
b.data &&
a.elements ==
b.elements &&
278 a.attributes ==
b.attributes;
287 const labelt &label = entry.first;
296 const auto &children = data.
children();
305 if(data.
data().size() == 0)
307 if(data.
data().size() == 1)
virtual void clear()
Reset the abstract state.
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Thrown when failing to deserialize a value from some low level format, like JSON or raw bytes.
A way of representing nested key/value data.
const std::map< labelt, structured_data_entryt > & data() const
static std::string unescape(const std::string &s)
takes a string and unescapes any xml style escaped symbols
void set_attribute(const std::string &attribute, unsigned value)
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)
ranget< iteratort > make_range(iteratort begin, iteratort end)
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
#define PRECONDITION(CONDITION)
int unsafe_string2int(const std::string &str, int base)
std::string kebab_case() const
std::string leaf_data() const
const std::map< labelt, structured_data_entryt > & children() const
xmlt to_xml(const structured_datat &data)
Convert the structured_datat into an xml object.
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)