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
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 
105  static std::string nextTagData(const char* tag, std::string const& xml, int* offset);
106 
108  static std::string xmlEncode(const std::string& raw);
109 
111  static std::string xmlDecode(const std::string& encoded);
112 
113 
115  static void log(int level, const char* fmt, ...);
116 
118  static void error(const char* fmt, ...);
119 
120  };
121 } // namespace XmlRpc
122 
123 #endif // _XMLRPCUTIL_H_
XmlRpc::setVerbosity
XMLRPCPP_DECL void setVerbosity(int level)
Sets log message verbosity. This is short for XmlRpcLogHandler::setVerbosity(level)
Definition: XmlRpcUtil.cpp:77
XmlRpc::XmlRpcLogHandler::~XmlRpcLogHandler
virtual ~XmlRpcLogHandler()
Definition: XmlRpcUtil.h:49
XmlRpc::XmlRpcLogHandler
An interface allowing custom handling of informational message reporting.
Definition: XmlRpcUtil.h:47
XmlRpc::getVerbosity
XMLRPCPP_DECL int getVerbosity()
Returns log message verbosity. This is short for XmlRpcLogHandler::getVerbosity()
Definition: XmlRpcUtil.cpp:76
XmlRpc
Definition: XmlRpcClient.h:20
XmlRpc::XmlRpcLogHandler::getLogHandler
static XmlRpcLogHandler * getLogHandler()
Returns a pointer to the currently installed message reporting object.
Definition: XmlRpcUtil.h:52
XmlRpc::XmlRpcErrorHandler::~XmlRpcErrorHandler
virtual ~XmlRpcErrorHandler()
Definition: XmlRpcUtil.h:29
XmlRpcDecl.h
XmlRpc::XmlRpcErrorHandler::setErrorHandler
static void setErrorHandler(XmlRpcErrorHandler *eh)
Specifies the error handler.
Definition: XmlRpcUtil.h:36
XmlRpc::XmlRpcLogHandler::setVerbosity
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
XmlRpc::XmlRpcErrorHandler::_errorHandler
static XMLRPCPP_DECL XmlRpcErrorHandler * _errorHandler
Definition: XmlRpcUtil.h:43
XmlRpc::XmlRpcLogHandler::setLogHandler
static void setLogHandler(XmlRpcLogHandler *lh)
Specifies the message handler.
Definition: XmlRpcUtil.h:56
XmlRpc::XmlRpcErrorHandler::error
virtual void error(const char *msg)=0
Report an error. Custom error handlers should define this method.
XmlRpc::XmlRpcErrorHandler
An interface allowing custom handling of error message reporting.
Definition: XmlRpcUtil.h:27
XmlRpc::XmlRpcUtil
Utilities for XML parsing, encoding, and decoding and message handlers.
Definition: XmlRpcUtil.h:84
XMLRPCPP_DECL
#define XMLRPCPP_DECL
Definition: XmlRpcDecl.h:52
XmlRpc::XmlRpcLogHandler::_verbosity
static XMLRPCPP_DECL int _verbosity
Definition: XmlRpcUtil.h:72
XmlRpc::XMLRPC_VERSION
const XMLRPCPP_DECL char XMLRPC_VERSION[]
Version identifier.
Definition: XmlRpcUtil.cpp:25
XmlRpc::XmlRpcErrorHandler::getErrorHandler
static XmlRpcErrorHandler * getErrorHandler()
Returns a pointer to the currently installed error handling object.
Definition: XmlRpcUtil.h:32
XmlRpc::XmlRpcLogHandler::_logHandler
static XMLRPCPP_DECL XmlRpcLogHandler * _logHandler
Definition: XmlRpcUtil.h:71
XmlRpc::XmlRpcLogHandler::log
virtual void log(int level, const char *msg)=0
Output a message. Custom error handlers should define this method.
XmlRpc::XmlRpcLogHandler::getVerbosity
static int getVerbosity()
Returns the level of verbosity of informational messages. 0 is no output, 5 is very verbose.
Definition: XmlRpcUtil.h:60


xmlrpcpp
Author(s): Chris Morley, Konstantin Pilipchuk, Morgan Quigley, Austin Hendrix, Dirk Thomas , Jacob Perron
autogenerated on Sat Sep 14 2024 02:59:32