cprover
xmlt Class Reference

#include <xml.h>

Collaboration diagram for xmlt:
[legend]

Public Types

typedef std::list< xmltelementst
 
typedef std::map< std::string, std::string > attributest
 

Public Member Functions

 xmlt ()
 
 xmlt (const std::string &_name)
 
elementst::const_iterator find (const std::string &name) const
 
elementst::iterator find (const std::string &name)
 
void set_attribute (const std::string &attribute, unsigned value)
 
void set_attribute (const std::string &attribute, unsigned long value)
 
void set_attribute (const std::string &attribute, unsigned long long value)
 
void set_attribute (const std::string &attribute, const std::string &value)
 
std::string get_attribute (const std::string &attribute) const
 
void set_attribute_bool (const std::string &attribute, bool value)
 
bool get_attribute_bool (const std::string &attribute) const
 
std::string get_element (const std::string &element) const
 
xmltnew_element (const std::string &name)
 
xmltnew_element (const xmlt &xml)
 
xmltnew_element ()
 
void swap (xmlt &xml)
 
void clear ()
 
void output (std::ostream &out, unsigned indent=0) const
 

Static Public Member Functions

static void escape (const std::string &s, std::ostream &out)
 escaping for XML elements More...
 
static std::string unescape (const std::string &s)
 takes a string and unescapes any xml style escaped symbols More...
 
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 More...
 

Public Attributes

std::string name
 
std::string data
 
attributest attributes
 
elementst elements
 

Static Protected Member Functions

static void do_indent (std::ostream &out, unsigned indent)
 

Detailed Description

Definition at line 18 of file xml.h.

Member Typedef Documentation

◆ attributest

typedef std::map<std::string, std::string> xmlt::attributest

Definition at line 28 of file xml.h.

◆ elementst

typedef std::list<xmlt> xmlt::elementst

Definition at line 27 of file xml.h.

Constructor & Destructor Documentation

◆ xmlt() [1/2]

xmlt::xmlt ( )
inline

Definition at line 21 of file xml.h.

Referenced by new_element().

◆ xmlt() [2/2]

xmlt::xmlt ( const std::string &  _name)
inlineexplicit

Definition at line 24 of file xml.h.

Member Function Documentation

◆ clear()

void xmlt::clear ( void  )

Definition at line 15 of file xml.cpp.

References attributes, elements, and name.

Referenced by xml_parse_treet::clear().

◆ do_indent()

void xmlt::do_indent ( std::ostream &  out,
unsigned  indent 
)
staticprotected

Definition at line 147 of file xml.cpp.

Referenced by output().

◆ escape()

void xmlt::escape ( const std::string &  s,
std::ostream &  out 
)
static

escaping for XML elements

Definition at line 78 of file xml.cpp.

Referenced by value_set_analysist::convert().

◆ escape_attribute()

void xmlt::escape_attribute ( const std::string &  s,
std::ostream &  out 
)
static

escaping for XML attributes, assuming that double quotes " are used consistently, not single quotes

Definition at line 115 of file xml.cpp.

Referenced by output(), and call_grapht::output_xml().

◆ find() [1/2]

xmlt::elementst::const_iterator xmlt::find ( const std::string &  name) const

Definition at line 152 of file xml.cpp.

References elements, and name.

Referenced by get_element().

◆ find() [2/2]

xmlt::elementst::iterator xmlt::find ( const std::string &  name)

Definition at line 163 of file xml.cpp.

References elements, and name.

◆ get_attribute()

std::string xmlt::get_attribute ( const std::string &  attribute) const
inline

Definition at line 54 of file xml.h.

References attributes.

Referenced by build_graph_rec(), convert(), and read_goto_object().

◆ get_attribute_bool()

bool xmlt::get_attribute_bool ( const std::string &  attribute) const
inline

Definition at line 70 of file xml.h.

References attributes.

◆ get_element()

std::string xmlt::get_element ( const std::string &  element) const
inline

Definition at line 78 of file xml.h.

References elements, and find().

◆ new_element() [1/3]

◆ new_element() [2/3]

xmlt& xmlt::new_element ( const xmlt xml)
inline

Definition at line 93 of file xml.h.

References elements, and xml().

◆ new_element() [3/3]

xmlt& xmlt::new_element ( )
inline

Definition at line 99 of file xml.h.

References elements, and xmlt().

◆ output()

void xmlt::output ( std::ostream &  out,
unsigned  indent = 0 
) const

Definition at line 31 of file xml.cpp.

References attributes, do_indent(), elements, escape_attribute(), and name.

Referenced by operator<<(), and xml_irep_convertt::output_map().

◆ set_attribute() [1/4]

◆ set_attribute() [2/4]

void xmlt::set_attribute ( const std::string &  attribute,
unsigned long  value 
)

Definition at line 181 of file xml.cpp.

References set_attribute().

◆ set_attribute() [3/4]

void xmlt::set_attribute ( const std::string &  attribute,
unsigned long long  value 
)

Definition at line 188 of file xml.cpp.

References set_attribute().

◆ set_attribute() [4/4]

void xmlt::set_attribute ( const std::string &  attribute,
const std::string &  value 
)

Definition at line 195 of file xml.cpp.

References attributes.

◆ set_attribute_bool()

void xmlt::set_attribute_bool ( const std::string &  attribute,
bool  value 
)
inline

Definition at line 63 of file xml.h.

References set_attribute().

Referenced by convert(), and show_goto_functions_xmlt::convert().

◆ swap()

void xmlt::swap ( xmlt xml)

Definition at line 23 of file xml.cpp.

References attributes, data, elements, name, and xml().

Referenced by convert(), parse_xml(), and xml_parse_treet::swap().

◆ unescape()

std::string xmlt::unescape ( const std::string &  str)
static

takes a string and unescapes any xml style escaped symbols

parameters: a string
Returns
the unescaped string

Definition at line 213 of file xml.cpp.

References unsafe_string2int().

Referenced by yyxmlparse().

Member Data Documentation

◆ attributes

attributest xmlt::attributes

Definition at line 32 of file xml.h.

Referenced by clear(), get_attribute(), get_attribute_bool(), output(), set_attribute(), and swap().

◆ data

◆ elements

◆ name


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