sipxtacklib  Version 3.3
XmlRpcBody.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 #ifndef _XMLRPCBODY_H_
12 #define _XMLRPCBODY_H_
13 
14 // SYSTEM INCLUDES
15 // APPLICATION INCLUDES
16 #include <net/HttpBody.h>
17 
18 // DEFINES
19 #define CONTENT_TYPE_TEXT_XML "text/xml"
20 
21 #define BEGIN_METHOD_CALL "<methodCall>\n"
22 #define END_METHOD_CALL "</methodCall>\n"
23 
24 #define BEGIN_METHOD_NAME "<methodName>"
25 #define END_METHOD_NAME "</methodName>\n"
26 
27 #define BEGIN_PARAMS "<params>\n"
28 #define END_PARAMS "</params>\n"
29 
30 #define BEGIN_PARAM "<param>\n"
31 #define END_PARAM "</param>\n"
32 
33 #define BEGIN_I4 "<value><i4>"
34 #define END_I4 "</i4></value>\n"
35 
36 #define BEGIN_INT "<value><int>"
37 #define END_INT "</int></value>\n"
38 
39 #define BEGIN_I8 "<value><i8>"
40 #define END_I8 "</i8></value>\n"
41 
42 #define BEGIN_BOOLEAN "<value><boolean>"
43 #define END_BOOLEAN "</boolean></value>\n"
44 
45 #define BEGIN_STRING "<value><string>"
46 #define END_STRING "</string></value>\n"
47 
48 #define BEGIN_TIME "<value><dateTime.iso8601>"
49 #define END_TIME "</dataTime.iso8601></value>\n"
50 
51 #define BEGIN_ARRAY "<value><array><data>\n"
52 #define END_ARRAY "</data></array></value>\n"
53 
54 #define BEGIN_STRUCT "<value><struct>\n"
55 #define END_STRUCT "</struct></value>\n"
56 
57 #define BEGIN_MEMBER "<member>\n"
58 #define END_MEMBER "</member>\n"
59 
60 #define BEGIN_NAME "<name>"
61 #define END_NAME "</name>"
62 
63 #define BEGIN_RESPONSE "<methodResponse>\n"
64 #define END_RESPONSE "</methodResponse>\n"
65 
66 #define BEGIN_FAULT "<fault>\n"
67 #define END_FAULT "</fault>\n"
68 
69 #define FAULT_CODE "<name>faultCode</name>"
70 #define FAULT_STRING "<name>faultString</name>"
71 
72 // MACROS
73 // EXTERNAL FUNCTIONS
74 // EXTERNAL VARIABLES
75 // CONSTANTS
76 
77 // STRUCTS
78 // TYPEDEFS
79 // FORWARD DECLARATIONS
80 
87 class XmlRpcBody : public HttpBody
88 {
89 /* //////////////////////////// PUBLIC //////////////////////////////////// */
90  public:
91 
93  XmlRpcBody();
94 
96  virtual ~XmlRpcBody();
97 
99  void append(const char* string);
100 
102  virtual int getLength() const;
103 
105  virtual void getBytes(const char** bytes,
106  int* length
107  ) const;
108 
110  virtual void getBytes(UtlString* bytes,
111  int* length
112  ) const;
113 
115  bool addValue(UtlContainable* value);
116 
118  bool addArray(UtlSList* array);
119 
121  bool addStruct(UtlHashMap* members);
122 
123 /* //////////////////////////// PROTECTED ///////////////////////////////// */
124  protected:
125 
126 
127 /* //////////////////////////// PRIVATE /////////////////////////////////// */
128  private:
129 
131  XmlRpcBody(const XmlRpcBody& rXmlRpcBody);
132 
134  XmlRpcBody& operator=(const XmlRpcBody& rhs);
135 
136 };
137 
138 /* ============================ INLINE METHODS ============================ */
139 
140 #endif // _XMLRPCBODY_H_
XmlRpcBody()
Construct an empty body of a XML-RPC.
Definition: XmlRpcBody.cpp:39
void append(const char *string)
Append the string to the body.
Definition: XmlRpcBody.cpp:52
virtual const char * getBytes() const
Definition: HttpBody.cpp:476
bool addValue(UtlContainable *value)
Add a value to the XML-RPC content.
Definition: XmlRpcBody.cpp:82
virtual int getLength() const
Get the string length of this object.
Definition: XmlRpcBody.cpp:60
virtual ~XmlRpcBody()
Destructor.
Definition: XmlRpcBody.cpp:45
This class contains all the contents presented in a XML-RPC body.
Definition: XmlRpcBody.h:87
bool addArray(UtlSList *array)
Add an array to the XML-RPC content.
Definition: XmlRpcBody.cpp:158
bool addStruct(UtlHashMap *members)
Add a struct to the XML-RPC content.
Definition: XmlRpcBody.cpp:174
class to contain an HTTP body
Definition: HttpBody.h:55

sipXtackLib home page