HPCToolkit
xml Namespace Reference

Classes

class  RWError
 

Enumerations

enum  XMLElementI {
  TOKEN = 0, ATT1 = 1, ATT2 = 2, ATT3 = 3,
  ATT4 = 4, ATT5 = 5, ATT6 = 6, ATT7 = 7,
  ATT8 = 8, ATT9 = 9
}
 
enum  { ESC_FALSE = (0 << 0), ESC_TRUE = (1 << 0), UNESC_FALSE = (0 << 0), UNESC_TRUE = (1 << 0) }
 

Functions

static string substitute (const char *str, const string *fromStrs, const string *toStrs)
 
std::string EscapeStr (const char *str)
 
std::string EscapeStr (const std::string &str)
 
std::string UnEscapeStr (const char *str)
 
std::string UnEscapeStr (const std::string &str)
 
bool ReadAttrStr (std::istream &is, std::string &s, int flags=UNESC_TRUE)
 
template<class T >
bool ReadAttrNum (std::istream &is, T &n)
 
bool WriteAttrStr (std::ostream &os, const char *s, int flags=ESC_TRUE)
 
bool WriteAttrStr (std::ostream &os, const std::string &s, int flags=ESC_TRUE)
 
template<class T >
bool WriteAttrNum (std::ostream &os, T n)
 
std::string MakeAttrStr (const char *x, int flags=ESC_TRUE)
 
std::string MakeAttrStr (const std::string &x, int flags=ESC_TRUE)
 
std::string MakeAttrNum (int x)
 
std::string MakeAttrNum (unsigned int x, int base=10)
 
std::string MakeAttrNum (int64_t x)
 
std::string MakeAttrNum (uint64_t x, int base=10)
 
std::string MakeAttrNum (double x, const char *format="%g")
 

Variables

static const int numSubs = 4
 
static const string RegStrs [] = {"<", ">", "&", "\""}
 
static const string EscStrs [] = {"&lt;", "&gt;", "&amp;", "&quot;"}
 
const std::string SPC = " "
 
const std::string eleB = "<"
 
const std::string eleBf = "</"
 
const std::string eleE = ">"
 
const std::string eleEc = "/>"
 
const std::string attB = "=\""
 
const std::string attE = "\""
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ESC_FALSE 
ESC_TRUE 
UNESC_FALSE 
UNESC_TRUE 

Definition at line 108 of file xml.hpp.

◆ XMLElementI

Enumerator
TOKEN 
ATT1 
ATT2 
ATT3 
ATT4 
ATT5 
ATT6 
ATT7 
ATT8 
ATT9 

Definition at line 93 of file xml.hpp.

Function Documentation

◆ EscapeStr() [1/2]

string xml::EscapeStr ( const char *  str)

Definition at line 138 of file xml.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EscapeStr() [2/2]

std::string xml::EscapeStr ( const std::string &  str)
inline

Definition at line 120 of file xml.hpp.

Here is the call graph for this function:

◆ MakeAttrNum() [1/5]

std::string xml::MakeAttrNum ( int  x)
inline

Definition at line 228 of file xml.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MakeAttrNum() [2/5]

std::string xml::MakeAttrNum ( unsigned int  x,
int  base = 10 
)
inline

Definition at line 233 of file xml.hpp.

Here is the call graph for this function:

◆ MakeAttrNum() [3/5]

std::string xml::MakeAttrNum ( int64_t  x)
inline

Definition at line 238 of file xml.hpp.

Here is the call graph for this function:

◆ MakeAttrNum() [4/5]

std::string xml::MakeAttrNum ( uint64_t  x,
int  base = 10 
)
inline

Definition at line 243 of file xml.hpp.

Here is the call graph for this function:

◆ MakeAttrNum() [5/5]

std::string xml::MakeAttrNum ( double  x,
const char *  format = "%g" 
)
inline

Definition at line 248 of file xml.hpp.

Here is the call graph for this function:

◆ MakeAttrStr() [1/2]

std::string xml::MakeAttrStr ( const char *  x,
int  flags = ESC_TRUE 
)
inline

Definition at line 216 of file xml.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MakeAttrStr() [2/2]

std::string xml::MakeAttrStr ( const std::string &  x,
int  flags = ESC_TRUE 
)
inline

Definition at line 222 of file xml.hpp.

Here is the call graph for this function:

◆ ReadAttrNum()

template<class T >
bool xml::ReadAttrNum ( std::istream &  is,
T n 
)

Definition at line 145 of file xml.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadAttrStr()

bool xml::ReadAttrStr ( std::istream &  is,
std::string &  s,
int  flags = UNESC_TRUE 
)
Here is the caller graph for this function:

◆ substitute()

static string xml::substitute ( const char *  str,
const string *  fromStrs,
const string *  toStrs 
)
static

Definition at line 152 of file xml.cpp.

Here is the caller graph for this function:

◆ UnEscapeStr() [1/2]

string xml::UnEscapeStr ( const char *  str)

Definition at line 145 of file xml.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UnEscapeStr() [2/2]

std::string xml::UnEscapeStr ( const std::string &  str)
inline

Definition at line 128 of file xml.hpp.

Here is the call graph for this function:

◆ WriteAttrNum()

template<class T >
bool xml::WriteAttrNum ( std::ostream &  os,
T  n 
)

Definition at line 205 of file xml.hpp.

Here is the caller graph for this function:

◆ WriteAttrStr() [1/2]

bool xml::WriteAttrStr ( std::ostream &  os,
const char *  s,
int  flags = ESC_TRUE 
)

Definition at line 112 of file xml.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteAttrStr() [2/2]

bool xml::WriteAttrStr ( std::ostream &  os,
const std::string &  s,
int  flags = ESC_TRUE 
)
inline

Definition at line 194 of file xml.hpp.

Here is the call graph for this function:

Variable Documentation

◆ attB

const string xml::attB = "=\""

Definition at line 84 of file xml.cpp.

◆ attE

const string xml::attE = "\""

Definition at line 85 of file xml.cpp.

◆ eleB

const string xml::eleB = "<"

Definition at line 80 of file xml.cpp.

◆ eleBf

const string xml::eleBf = "</"

Definition at line 81 of file xml.cpp.

◆ eleE

const string xml::eleE = ">"

Definition at line 82 of file xml.cpp.

◆ eleEc

const string xml::eleEc = "/>"

Definition at line 83 of file xml.cpp.

◆ EscStrs

const string xml::EscStrs[] = {"&lt;", "&gt;", "&amp;", "&quot;"}
static

Definition at line 133 of file xml.cpp.

◆ numSubs

const int xml::numSubs = 4
static

Definition at line 131 of file xml.cpp.

◆ RegStrs

const string xml::RegStrs[] = {"<", ">", "&", "\""}
static

Definition at line 132 of file xml.cpp.

◆ SPC

const string xml::SPC = " "

Definition at line 79 of file xml.cpp.