GNU CommonC++
Public Member Functions | Protected Member Functions | List of all members
ost::XMLRPC Class Referenceabstract

This class impliments a core XMLRPC service without the underlying transports. More...

#include <xml.h>

Inheritance diagram for ost::XMLRPC:
ost::XMLStream

Public Member Functions

 XMLRPC (size_t bufferSize=512)
 Construct XMLRPC workspace. More...
 
virtual ~XMLRPC ()
 Destroy XMLRPC object. More...
 
void begArray (void)
 Create an array. More...
 
void endArray (void)
 end an array. More...
 
void invoke (const char *method)
 Create XMLRPC "method" call in buffer. More...
 
void response (bool fault)
 Create XMLRPC "reply" to a method call. More...
 
void addParam (bool value)
 Add bool param to XMLRPC request. More...
 
void addMember (const char *name, bool value)
 Add bool member to a XMLRPC struct. More...
 
void addParam (long value)
 Add an integer paramater to XMLRPC request. More...
 
void addMember (const char *name, long value)
 Add an integer member to XMLRPC struct. More...
 
void addParam (const char *string)
 Add a string paramater to XMLRPC request. More...
 
void addMember (const char *name, const char *value)
 Add a string member to XMLRPC struct. More...
 
void endStruct (void)
 Clear a struct. More...
 
bool send (const char *resource)
 Complete buffer and send well formed XMLRPC request thru post. More...
 
- Public Member Functions inherited from ost::XMLStream
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 Slog::Level getLogging (void)
 Get error logging level. 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...
 
virtual void startDocument (void)
 Identify start of document event. More...
 
virtual void endDocument (void)
 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...
 
void begStruct (void)
 Start member struct. More...
 
- Protected Member Functions inherited from ost::XMLStream
virtual ~XMLStream ()
 

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

Constructor & Destructor Documentation

◆ XMLRPC()

ost::XMLRPC::XMLRPC ( size_t  bufferSize = 512)

Construct XMLRPC workspace.

Parameters
bufferSizesize of buffer when using old C++ strstreams. When the newer stringstream (<sstream>) is available, this parameter is silently ignored.

◆ ~XMLRPC()

virtual ost::XMLRPC::~XMLRPC ( )
virtual

Destroy XMLRPC object.

Member Function Documentation

◆ addMember() [1/3]

void ost::XMLRPC::addMember ( const char *  name,
bool  value 
)

Add bool member to a XMLRPC struct.

Parameters
nameof member.
valueof member.

◆ addMember() [2/3]

void ost::XMLRPC::addMember ( const char *  name,
const char *  value 
)

Add a string member to XMLRPC struct.

Parameters
nameof member.
valueof member.

◆ addMember() [3/3]

void ost::XMLRPC::addMember ( const char *  name,
long  value 
)

Add an integer member to XMLRPC struct.

Parameters
nameof member.
valueof member.

◆ addParam() [1/3]

void ost::XMLRPC::addParam ( bool  value)

Add bool param to XMLRPC request.

Parameters
valueto add.

◆ addParam() [2/3]

void ost::XMLRPC::addParam ( const char *  string)

Add a string paramater to XMLRPC request.

Parameters
stringto add.

◆ addParam() [3/3]

void ost::XMLRPC::addParam ( long  value)

Add an integer paramater to XMLRPC request.

Parameters
valueto add.

◆ begArray()

void ost::XMLRPC::begArray ( void  )

Create an array.

◆ begStruct()

void ost::XMLRPC::begStruct ( void  )
protected

Start member struct.

◆ endArray()

void ost::XMLRPC::endArray ( void  )

end an array.

◆ endStruct()

void ost::XMLRPC::endStruct ( void  )

Clear a struct.

◆ invoke()

void ost::XMLRPC::invoke ( const char *  method)

Create XMLRPC "method" call in buffer.

Parameters
methodname of method being called.

◆ post()

virtual bool ost::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
resourceto send to (such as url).
msgwell formed XMLRPC request message.

◆ response()

void ost::XMLRPC::response ( bool  fault)

Create XMLRPC "reply" to a method call.

Parameters
faultset true for fault message.

◆ send()

bool ost::XMLRPC::send ( const char *  resource)

Complete buffer and send well formed XMLRPC request thru post.

Returns
true if successful.
Parameters
resourceto send to.

The documentation for this class was generated from the following file: