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 strcasecmp _stricmp
18 # define strncasecmp _strnicmp
19 #elif defined(__BORLANDC__)
20 # define strcasecmp stricmp
21 # define strncasecmp strnicmp
22 #endif
23 
24 namespace XmlRpc {
25 
28  public:
29  virtual ~XmlRpcErrorHandler() { }
30 
33  { return _errorHandler; }
34 
37  { _errorHandler = eh; }
38 
40  virtual void error(const char* msg) = 0;
41 
42  protected:
44  };
45 
48  public:
49  virtual ~XmlRpcLogHandler() { }
50 
53  { return _logHandler; }
54 
57  { _logHandler = lh; }
58 
60  static int getVerbosity()
61  { return _verbosity; }
62 
64  static void setVerbosity(int v)
65  { _verbosity = v; }
66 
68  virtual void log(int level, const char* msg) = 0;
69 
70  protected:
73  };
74 
78  XMLRPCPP_DECL void setVerbosity(int level);
79 
81  extern XMLRPCPP_DECL const char XMLRPC_VERSION[];
82 
85  public:
86  // hokey xml parsing
88  static std::string parseTag(const char* tag, std::string const& xml, int* offset);
89 
91  static bool findTag(const char* tag, std::string const& xml, int* offset);
92 
95  static std::string getNextTag(std::string const& xml, int* offset);
96 
99  static bool nextTagIs(const char* tag, std::string const& xml, int* offset);
100 
101 
103  static std::string xmlEncode(const std::string& raw);
104 
106  static std::string xmlDecode(const std::string& encoded);
107 
108 
110  static void log(int level, const char* fmt, ...);
111 
113  static void error(const char* fmt, ...);
114 
115  };
116 } // namespace XmlRpc
117 
118 #endif // _XMLRPCUTIL_H_
virtual ~XmlRpcLogHandler()
Definition: XmlRpcUtil.h:49
static XmlRpcLogHandler * getLogHandler()
Returns a pointer to the currently installed message reporting object.
Definition: XmlRpcUtil.h:52
static void setLogHandler(XmlRpcLogHandler *lh)
Specifies the message handler.
Definition: XmlRpcUtil.h:56
XMLRPCPP_DECL const char XMLRPC_VERSION[]
Version identifier.
Definition: XmlRpcUtil.cpp:24
static XMLRPCPP_DECL int _verbosity
Definition: XmlRpcUtil.h:72
static XMLRPCPP_DECL XmlRpcErrorHandler * _errorHandler
Definition: XmlRpcUtil.h:43
static int getVerbosity()
Returns the level of verbosity of informational messages. 0 is no output, 5 is very verbose...
Definition: XmlRpcUtil.h:60
static void setVerbosity(int v)
Specify the level of verbosity of informational messages. 0 is no output, 5 is very verbose...
Definition: XmlRpcUtil.h:64
static XmlRpcErrorHandler * getErrorHandler()
Returns a pointer to the currently installed error handling object.
Definition: XmlRpcUtil.h:32
Utilities for XML parsing, encoding, and decoding and message handlers.
Definition: XmlRpcUtil.h:84
virtual void error(const char *msg)=0
Report an error. Custom error handlers should define this method.
XMLRPCPP_DECL int getVerbosity()
Returns log message verbosity. This is short for XmlRpcLogHandler::getVerbosity() ...
Definition: XmlRpcUtil.cpp:75
XMLRPCPP_DECL 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:47
#define XMLRPCPP_DECL
Definition: XmlRpcDecl.h:52
static XMLRPCPP_DECL XmlRpcLogHandler * _logHandler
Definition: XmlRpcUtil.h:71
static void setErrorHandler(XmlRpcErrorHandler *eh)
Specifies the error handler.
Definition: XmlRpcUtil.h:36
An interface allowing custom handling of error message reporting.
Definition: XmlRpcUtil.h:27


xmlrpcpp
Author(s): Chris Morley, Konstantin Pilipchuk, Morgan Quigley, Austin Hendrix
autogenerated on Mon Jun 1 2020 03:22:44