~efargaspro/+junk/codeblocks-16.01-release

« back to all changes in this revision

Viewing changes to src/plugins/contrib/PythonPlugins/XmlRpcEmbedder/XMLRPC/include/XmlRpc.h

  • Committer: damienlmoore at gmail
  • Date: 2016-02-02 02:43:22 UTC
  • Revision ID: damienlmoore@gmail.com-20160202024322-yql5qmtbwdyamdwd
Code::BlocksĀ 16.01

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _XMLRPC_H_
 
2
#define _XMLRPC_H_
 
3
//
 
4
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
 
5
// This library is free software; you can redistribute it and/or
 
6
// modify it under the terms of the GNU Lesser General Public
 
7
// License as published by the Free Software Foundation; either
 
8
// version 2.1 of the License, or (at your option) any later version.
 
9
// 
 
10
// This library is distributed in the hope that it will be useful,
 
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
// Lesser General Public License for more details.
 
14
// 
 
15
// You should have received a copy of the GNU Lesser General Public
 
16
// License along with this library; if not, write to the Free Software
 
17
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 
18
// 
 
19
 
 
20
#if defined(_MSC_VER)
 
21
# pragma warning(disable:4786)    // identifier was truncated in debug info
 
22
#endif
 
23
 
 
24
#ifndef MAKEDEPEND
 
25
# include <string>
 
26
#endif
 
27
 
 
28
#include "XmlRpcClient.h"
 
29
#include "XmlRpcException.h"
 
30
#include "XmlRpcServer.h"
 
31
#include "XmlRpcServerMethod.h"
 
32
#include "XmlRpcValue.h"
 
33
#include "XmlRpcUtil.h"
 
34
 
 
35
namespace XmlRpc {
 
36
 
 
37
 
 
38
  //! An interface allowing custom handling of error message reporting.
 
39
  class XmlRpcErrorHandler {
 
40
  public:
 
41
    //! Returns a pointer to the currently installed error handling object.
 
42
    static XmlRpcErrorHandler* getErrorHandler() 
 
43
    { return _errorHandler; }
 
44
 
 
45
    //! Specifies the error handler.
 
46
    static void setErrorHandler(XmlRpcErrorHandler* eh)
 
47
    { _errorHandler = eh; }
 
48
 
 
49
    //! Report an error. Custom error handlers should define this method.
 
50
    virtual void error(const char* msg) = 0;
 
51
 
 
52
  protected:
 
53
    static XmlRpcErrorHandler* _errorHandler;
 
54
  };
 
55
 
 
56
  //! An interface allowing custom handling of informational message reporting.
 
57
  class XmlRpcLogHandler {
 
58
  public:
 
59
    //! Returns a pointer to the currently installed message reporting object.
 
60
    static XmlRpcLogHandler* getLogHandler() 
 
61
    { return _logHandler; }
 
62
 
 
63
    //! Specifies the message handler.
 
64
    static void setLogHandler(XmlRpcLogHandler* lh)
 
65
    { _logHandler = lh; }
 
66
 
 
67
    //! Returns the level of verbosity of informational messages. 0 is no output, 5 is very verbose.
 
68
    static int getVerbosity() 
 
69
    { return _verbosity; }
 
70
 
 
71
    //! Specify the level of verbosity of informational messages. 0 is no output, 5 is very verbose.
 
72
    static void setVerbosity(int v) 
 
73
    { _verbosity = v; }
 
74
 
 
75
    //! Output a message. Custom error handlers should define this method.
 
76
    virtual void log(int level, const char* msg) = 0;
 
77
 
 
78
  protected:
 
79
    static XmlRpcLogHandler* _logHandler;
 
80
    static int _verbosity;
 
81
  };
 
82
 
 
83
  //! Returns log message verbosity. This is short for XmlRpcLogHandler::getVerbosity()
 
84
  int getVerbosity();
 
85
  //! Sets log message verbosity. This is short for XmlRpcLogHandler::setVerbosity(level)
 
86
  void setVerbosity(int level);
 
87
 
 
88
 
 
89
  //! Version identifier
 
90
  extern const char XMLRPC_VERSION[];
 
91
 
 
92
} // namespace XmlRpc
 
93
 
 
94
#endif // _XMLRPC_H_