This class impliments a core XMLRPC service without the underlying transports.
More...
#include <xml.h>
Inheritance diagram for XMLRPC:
Collaboration diagram for XMLRPC:
Public Member Functions
XMLRPC (size_t bufferSize=512)
void
invoke (const char *method)
void
addMember (const char *name, bool value)
void
addMember (const char *name, long value)
void
addMember (const char *name, const char *value)
bool
send (const char *resource)
Complete buffer and send well formed
XMLRPC request thru post.
More...
virtual bool
open (const char *resource)
May perform an open operation on behalf of a parsed resource.
More...
virtual void
close (void)
May perform a close operation of an i/o source when the parser has completed operation.
More...
virtual void
comment (const unsigned char *text, size_t len)
Virtual to receive embedded comments in an XML document being parsed.
More...
virtual int
read (unsigned char *
buffer, size_t len)=0
Read method to aquire data for the parser.
More...
virtual void
characters (const unsigned char *text, size_t len)=0
Virtual to receive character text extracted from the document in the current element.
More...
Identify start of document event.
More...
Identify end of document event.
More...
virtual void
startElement (const unsigned char *name, const unsigned char **attr)=0
Identify start of an element in the document.
More...
virtual void
endElement (const unsigned char *name)=0
Identify end of an element in the document.
More...
bool
parse (const char *resource=NULL)
Parse a resource as a stream thru the virtual read method.
More...
Protected Member Functions
virtual bool
post (const char *resource, const char *msg)=0
Used in a derived transport class to deliver the
XMLRPC encoded request and return true if successful.
More...
Private Attributes
Detailed Description
This class impliments a core XMLRPC service without the underlying transports.
It is meant to create and parse XMLRPC messages. To use for a fit purpose, one might combine it with URLStream, although this implimentation makes no requirement for http based transport.
- Author
- David Sugar dyfet.nosp@m.@ost.nosp@m.el.co.nosp@m.m XML-RPC service building class
Definition at line 184 of file xml.h.
Constructor & Destructor Documentation
XMLRPC::XMLRPC
(
size_t
bufferSize = 512
)
Construct XMLRPC workspace.
- Parameters
-
bufferSize size of buffer when using old C++ strstreams. When the newer stringstream (<sstream>) is available, this parameter is silently ignored.
virtual XMLRPC::~XMLRPC
(
)
virtual
Member Function Documentation
void XMLRPC::addMember
(
const char *
name,
bool
value
)
Add bool member to a XMLRPC struct.
- Parameters
-
name of member.
value of member.
void XMLRPC::addMember
(
const char *
name,
long
value
)
Add an integer member to XMLRPC struct.
- Parameters
-
name of member.
value of member.
void XMLRPC::addMember
(
const char *
name,
const char *
value
)
Add a string member to XMLRPC struct.
- Parameters
-
name of member.
value of member.
void XMLRPC::addParam
(
bool
value )
Add bool param to XMLRPC request.
- Parameters
-
value to add.
void XMLRPC::addParam
(
long
value )
Add an integer paramater to XMLRPC request.
- Parameters
-
value to add.
void XMLRPC::addParam
(
const char *
string )
Add a string paramater to XMLRPC request.
- Parameters
-
string to add.
void XMLRPC::begArray
(
void
)
void XMLRPC::begStruct
(
void
)
protected
virtual void XMLStream::characters
(
const unsigned char *
text,
size_t
len
)
pure virtualinherited
Virtual to receive character text extracted from the document in the current element.
- Parameters
-
text received.
len length of text received.
virtual void XMLStream::close
(
void
)
virtualinherited
May perform a close operation of an i/o source when the parser has completed operation.
virtual void XMLStream::comment
(
const unsigned char *
text,
size_t
len
)
virtualinherited
Virtual to receive embedded comments in an XML document being parsed.
- Parameters
-
text text comment extracted.
len length of comment.
void XMLRPC::endArray
(
void
)
virtual void XMLStream::endDocument
(
void
)
virtualinherited
Identify end of document event.
virtual void XMLStream::endElement
(
const unsigned char *
name )
pure virtualinherited
Identify end of an element in the document.
- Parameters
-
name of element found.
void XMLRPC::endStruct
(
void
)
Get error logging level.
- Returns
- error logging level.
void XMLRPC::invoke
(
const char *
method )
Create XMLRPC "method" call in buffer.
- Parameters
-
method name of method being called.
virtual bool XMLStream::open
(
const char *
resource )
virtualinherited
May perform an open operation on behalf of a parsed resource.
In some cases, the parser may be merged with a class that already has performed some kind of open, and this method can then be ignored.
- Returns
- true if open is successful.
- Parameters
-
resource passed to Parse methods.
bool XMLStream::parse
(
const char *
resource = NULL
)
inherited
Parse a resource as a stream thru the virtual read method.
- Returns
- true if well formed document has been fully parsed.
- Parameters
-
resource optional name of resource.
virtual bool XMLRPC::post
(
const char *
resource,
const char *
msg
)
protectedpure virtual
Used in a derived transport class to deliver the XMLRPC encoded request and return true if successful.
The Parse method can then be used to decode the reply.
- Returns
- true if successful.
- Parameters
-
resource to send to (such as url).
msg well formed
XMLRPC request message.
virtual int XMLStream::read
(
unsigned char *
buffer,
size_t
len
)
pure virtualinherited
Read method to aquire data for the parser.
- Returns
- number of bytes actually read.
- Parameters
-
buffer to read data into.
len number of bytes to read.
void XMLRPC::response
(
bool
fault )
Create XMLRPC "reply" to a method call.
- Parameters
-
fault set true for fault message.
bool XMLRPC::send
(
const char *
resource )
Complete buffer and send well formed XMLRPC request thru post.
- Returns
- true if successful.
- Parameters
-
resource to send to.
virtual void XMLStream::startDocument
(
void
)
virtualinherited
Identify start of document event.
virtual void XMLStream::startElement
(
const unsigned char *
name,
const unsigned char **
attr
)
pure virtualinherited
Identify start of an element in the document.
- Parameters
-
name of element found.
attr list of attributes extracted.
Field Documentation
unsigned XMLRPC::array
private
char* XMLRPC::buffer
private
size_t XMLRPC::bufSize
private
bool XMLRPC::fault
private
std::strstream* XMLRPC::oldStrBuf
private
bool XMLRPC::reply
private
bool XMLRPC::structFlag
private
The documentation for this class was generated from the following file: