OverSim
XmlRpcUtil.h
Go to the documentation of this file.
1 #ifndef _XMLRPCUTIL_H_
2 #define _XMLRPCUTIL_H_
3 //
4 // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
5 //
6 
12 #if defined(_MSC_VER)
13 # pragma warning(disable:4786) // identifier was truncated in debug info
14 #endif
15 
16 #ifndef MAKEDEPEND
17 # include <string>
18 #endif
19 
20 #if defined(_MSC_VER)
21 # define snprintf _snprintf
22 # define vsnprintf _vsnprintf
23 # define strcasecmp _stricmp
24 # define strncasecmp _strnicmp
25 #elif defined(__BORLANDC__)
26 # define strcasecmp stricmp
27 # define strncasecmp strnicmp
28 #endif
29 
30 namespace XmlRpc {
31 
33  class XmlRpcUtil {
34  public:
35  // hokey xml parsing
37  static std::string parseTag(const char* tag, std::string const& xml, int* offset);
38 
40  static bool findTag(const char* tag, std::string const& xml, int* offset);
41 
44  static std::string getNextTag(std::string const& xml, int* offset);
45 
48  static bool nextTagIs(const char* tag, std::string const& xml, int* offset);
49 
50 
52  static std::string xmlEncode(const std::string& raw);
53 
55  static std::string xmlDecode(const std::string& encoded);
56 
57 
59  static void log(int level, const char* fmt, ...);
60 
62  static void error(const char* fmt, ...);
63 
64  };
65 } // namespace XmlRpc
66 
67 #endif // _XMLRPCUTIL_H_