7# pragma warning( disable : 4786 )
14#if defined( _MSC_VER )
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 );
45 static std::string
xmlEncode(
const std::string& raw );
48 static std::string
xmlDecode(
const std::string& encoded );
51 static void log(
int level,
const char* fmt, ... );
54 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.