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 #if defined(_MSC_VER)
7 # pragma warning(disable:4786) // identifier was truncated in debug info
8 #endif
9 
10 #ifndef MAKEDEPEND
11 # include <string>
12 #endif
13 
14 #include "xmlrpcpp/XmlRpcDecl.h"
15 
16 #if defined(_MSC_VER)
17 # define snprintf _snprintf_s
18 # define vsnprintf _vsnprintf_s
19 # define strcasecmp _stricmp
20 # define strncasecmp _strnicmp
21 #elif defined(__BORLANDC__)
22 # define strcasecmp stricmp
23 # define strncasecmp strnicmp
24 #endif
25 
26 namespace XmlRpc {
27 
30  public:
31  virtual ~XmlRpcErrorHandler() { }
32 
35  { return _errorHandler; }
36 
39  { _errorHandler = eh; }
40 
42  virtual void error(const char* msg) = 0;
43 
44  protected:
46  };
47 
50  public:
51  virtual ~XmlRpcLogHandler() { }
52 
55  { return _logHandler; }
56 
59  { _logHandler = lh; }
60 
62  static int getVerbosity()
63  { return _verbosity; }
64 
66  static void setVerbosity(int v)
67  { _verbosity = v; }
68 
70  virtual void log(int level, const char* msg) = 0;
71 
72  protected:
74  static int _verbosity;
75  };
76 
78  int getVerbosity();
80  void setVerbosity(int level);
81 
83  extern const char XMLRPC_VERSION[];
84 
87  public:
88  // hokey xml parsing
90  static std::string parseTag(const char* tag, std::string const& xml, int* offset);
91 
93  static bool findTag(const char* tag, std::string const& xml, int* offset);
94 
97  static std::string getNextTag(std::string const& xml, int* offset);
98 
101  static bool nextTagIs(const char* tag, std::string const& xml, int* offset);
102 
103 
105  static std::string xmlEncode(const std::string& raw);
106 
108  static std::string xmlDecode(const std::string& encoded);
109 
110 
112  static void log(int level, const char* fmt, ...);
113 
115  static void error(const char* fmt, ...);
116 
117  };
118 } // namespace XmlRpc
119 
120 #endif // _XMLRPCUTIL_H_
virtual ~XmlRpcLogHandler()
Definition: XmlRpcUtil.h:51
static XmlRpcLogHandler * getLogHandler()
Returns a pointer to the currently installed message reporting object.
Definition: XmlRpcUtil.h:54
static void setLogHandler(XmlRpcLogHandler *lh)
Specifies the message handler.
Definition: XmlRpcUtil.h:58
const char XMLRPC_VERSION[]
Version identifier.
Definition: XmlRpcUtil.cpp:24
static XmlRpcErrorHandler * _errorHandler
Definition: XmlRpcUtil.h:45
static int getVerbosity()
Returns the level of verbosity of informational messages. 0 is no output, 5 is very verbose...
Definition: XmlRpcUtil.h:62
static void setVerbosity(int v)
Specify the level of verbosity of informational messages. 0 is no output, 5 is very verbose...
Definition: XmlRpcUtil.h:66
static XmlRpcErrorHandler * getErrorHandler()
Returns a pointer to the currently installed error handling object.
Definition: XmlRpcUtil.h:34
Utilities for XML parsing, encoding, and decoding and message handlers.
Definition: XmlRpcUtil.h:86
virtual void error(const char *msg)=0
Report an error. Custom error handlers should define this method.
int getVerbosity()
Returns log message verbosity. This is short for XmlRpcLogHandler::getVerbosity() ...
Definition: XmlRpcUtil.cpp:75
void setVerbosity(int level)
Sets log message verbosity. This is short for XmlRpcLogHandler::setVerbosity(level) ...
Definition: XmlRpcUtil.cpp:76
An interface allowing custom handling of informational message reporting.
Definition: XmlRpcUtil.h:49
#define XMLRPCPP_DECL
Definition: XmlRpcDecl.h:52
static XmlRpcLogHandler * _logHandler
Definition: XmlRpcUtil.h:73
static void setErrorHandler(XmlRpcErrorHandler *eh)
Specifies the error handler.
Definition: XmlRpcUtil.h:38
An interface allowing custom handling of error message reporting.
Definition: XmlRpcUtil.h:29


xmlrpcpp
Author(s): Chris Morley, Konstantin Pilipchuk, Morgan Quigley, Austin Hendrix
autogenerated on Sun Feb 3 2019 03:29:51