7# pragma warning(disable:4786)
15# define snprintf _snprintf
16# define vsnprintf _vsnprintf
17# define strcasecmp _stricmp
18# define strncasecmp _strnicmp
19#elif defined(__BORLANDC__)
20# define strcasecmp stricmp
21# define strncasecmp strnicmp
31 static std::string
parseTag(
const char* tag, std::string
const& xml,
int* offset);
34 static bool findTag(
const char* tag, std::string
const& xml,
int* offset);
38 static std::string
getNextTag(std::string
const& xml,
int* offset);
42 static bool nextTagIs(
const char* tag, std::string
const& xml,
int* offset);
46 static std::string
xmlEncode(
const std::string& raw);
49 static std::string
xmlDecode(
const std::string& encoded);
53 static void log(
int level,
const char* fmt, ...);
56 static void error(
const char* fmt, ...);
Utilities for XML parsing, encoding, and decoding and message handlers.
static bool nextTagIs(const char *tag, std::string const &xml, int *offset)
static std::string parseTag(const char *tag, std::string const &xml, int *offset)
Returns contents between <tag> and </tag>, updates offset to char after </tag>
static void error(const char *fmt,...)
Dump error messages somewhere.
static std::string xmlEncode(const std::string &raw)
Convert raw text to encoded xml.
static bool findTag(const char *tag, std::string const &xml, int *offset)
Returns true if the tag is found and updates offset to the char after the tag.
static void log(int level, const char *fmt,...)
Dump messages somewhere.
static std::string getNextTag(std::string const &xml, int *offset)
static std::string xmlDecode(const std::string &encoded)
Convert encoded xml to raw text.