Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions

XMLRPCResponse Struct Reference

#include <xmlrpc.h>

Inheritance diagram for XMLRPCResponse:
Inheritance graph
[legend]
Collaboration diagram for XMLRPCResponse:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 XMLRPCResponse ()
void set_int (int i4)
void set_double (double d)
void set_bool (bool b)
void set_string (const string &s)
void set_string (const char *s)
void set_date (const ISODate &date)
void set_binary (const Binary &bin)
void set_array (const XMLRPCArray &arr)
void set_struct (const XMLRPCStruct &str)
void set_failure (int code, const string &message)
string flush ()

Protected Member Functions

void write_string_param (const string &value)
void write_param (const string &type, const string &value)
void write_param (const XMLRPCArray &arr)
void write_param (const XMLRPCStruct &str)
void write_struct (const XMLRPCStruct &str, const string &keyword)

Protected Attributes

ostringstream _buffer
XMLWriter _writer
int _params

Private Member Functions

void init ()

Detailed Description

Definition at line 333 of file xmlrpc.h.


Constructor & Destructor Documentation

XMLRPCResponse::XMLRPCResponse (  ) [inline]

Definition at line 335 of file xmlrpc.h.

    {
        init();
    }

Member Function Documentation

string XMLRPCWriter::flush (  ) [inherited]

Definition at line 216 of file xmlrpc.cpp.

References XMLRPCWriter::_buffer, XMLRPCWriter::_params, XMLRPCWriter::_writer, and XMLStorage::XMLWriter::back().

Referenced by XMLRPCClient::call(), and server_test().

{
    if (_params)
        _writer.back(); // </params>

    _writer.back(); // </methodCall> bzw. </methodResponse>

    return _buffer.str();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void XMLRPCResponse::init (  ) [private]

Definition at line 54 of file xmlrpc_srv.cpp.

References XMLRPCWriter::_writer, and XMLStorage::XMLWriter::create().

{
    _writer.create("methodResponse");

    // The <methodResponse> tag is closed in XMLRPCWriter::flush().
}

Here is the call graph for this function:

void XMLRPCResponse::set_array ( const XMLRPCArray arr ) [inline]

Definition at line 347 of file xmlrpc.h.

Referenced by server_test().

{write_param(arr);}

Here is the caller graph for this function:

void XMLRPCResponse::set_binary ( const Binary bin ) [inline]

Definition at line 346 of file xmlrpc.h.

References Binary::str().

Referenced by server_test().

{write_param("base64", bin.str());}

Here is the call graph for this function:

Here is the caller graph for this function:

void XMLRPCResponse::set_bool ( bool  b ) [inline]

Definition at line 342 of file xmlrpc.h.

{write_param("boolean", b? "1": "0");}
void XMLRPCResponse::set_date ( const ISODate date ) [inline]

Definition at line 345 of file xmlrpc.h.

References ISODate::str().

Referenced by server_test().

{write_param("dateTime.iso8601", date.str());}

Here is the call graph for this function:

Here is the caller graph for this function:

void XMLRPCResponse::set_double ( double  d ) [inline]

Definition at line 341 of file xmlrpc.h.

Referenced by server_test().

{write_param("double", XMLDouble(d));}

Here is the caller graph for this function:

void XMLRPCResponse::set_failure ( int  code,
const string &  message 
)

Definition at line 61 of file xmlrpc_srv.cpp.

References XMLRPCWriter::write_struct().

Referenced by server_test().

{
    XMLRPCStruct members;

    members["faultCode"] = (XS_String)XMLInt(code);
    members["faultString"] = message;

    write_struct(members, "fault");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void XMLRPCResponse::set_int ( int  i4 ) [inline]

Definition at line 340 of file xmlrpc.h.

Referenced by server_test().

{write_param("i4", XMLInt(i4));}

Here is the caller graph for this function:

void XMLRPCResponse::set_string ( const string &  s ) [inline]

Definition at line 343 of file xmlrpc.h.

Referenced by server_test().

Here is the caller graph for this function:

void XMLRPCResponse::set_string ( const char *  s ) [inline]

Definition at line 344 of file xmlrpc.h.

void XMLRPCResponse::set_struct ( const XMLRPCStruct str ) [inline]

Definition at line 348 of file xmlrpc.h.

Referenced by server_test().

{write_param(str);}

Here is the caller graph for this function:

void XMLRPCWriter::write_param ( const XMLRPCStruct str ) [protected, inherited]

Definition at line 274 of file xmlrpc.cpp.

References XMLRPCWriter::_params, XMLRPCWriter::_writer, XMLStorage::XMLWriter::create(), and XMLRPCWriter::write_struct().

{
    if (!_params++)
        _writer.create("params");

    write_struct(str, "param");
}

Here is the call graph for this function:

void XMLRPCWriter::write_param ( const XMLRPCArray arr ) [protected, inherited]

Definition at line 252 of file xmlrpc.cpp.

References XMLRPCWriter::_params, XMLRPCWriter::_writer, XMLStorage::XMLWriter::back(), XMLStorage::XMLWriter::create(), and XMLStorage::XMLWriter::set_content().

{
    if (!_params++)
        _writer.create("params");

    _writer.create("param");
      _writer.create("value");
        _writer.create("array");
          _writer.create("data");

            for(XMLRPCArray::const_iterator it=arr.begin(); it!=arr.end(); ++it) {
              _writer.create("value");
                _writer.set_content(*it);
              _writer.back();
            }

          _writer.back();
        _writer.back();
      _writer.back();
    _writer.back();
}

Here is the call graph for this function:

void XMLRPCWriter::write_param ( const string &  type,
const string &  value 
) [protected, inherited]

Definition at line 238 of file xmlrpc.cpp.

References XMLRPCWriter::_params, XMLRPCWriter::_writer, XMLStorage::XMLWriter::back(), XMLStorage::XMLWriter::create(), and XMLStorage::XMLWriter::set_content().

{
    if (!_params++)
        _writer.create("params");

    _writer.create("param");
        _writer.create("value");
            _writer.create(type);
                _writer.set_content(value);
            _writer.back();
        _writer.back();
    _writer.back();
}

Here is the call graph for this function:

void XMLRPCWriter::write_string_param ( const string &  value ) [protected, inherited]

Definition at line 226 of file xmlrpc.cpp.

References XMLRPCWriter::_params, XMLRPCWriter::_writer, XMLStorage::XMLWriter::back(), XMLStorage::XMLWriter::create(), and XMLStorage::XMLWriter::set_content().

{
    if (!_params++)
        _writer.create("params");

    _writer.create("param");
        _writer.create("value");
            _writer.set_content(value);
        _writer.back();
    _writer.back();
}

Here is the call graph for this function:

void XMLRPCWriter::write_struct ( const XMLRPCStruct str,
const string &  keyword 
) [protected, inherited]

Definition at line 284 of file xmlrpc.cpp.

References XMLRPCWriter::_writer, XMLStorage::XMLWriter::back(), XMLStorage::XMLWriter::create(), and XMLStorage::XMLWriter::set_content().

Referenced by set_failure(), and XMLRPCWriter::write_param().

{
    _writer.create(keyword);
      _writer.create("value");
        _writer.create("struct");

          for(XMLRPCStruct::const_iterator it=str.begin(); it!=str.end(); ++it) {
            _writer.create("member");
              _writer.create("name");
                _writer.set_content(it->first);
              _writer.back();

              _writer.create("value");
                _writer.set_content(it->second);
              _writer.back();
            _writer.back();
          }

        _writer.back();
      _writer.back();
    _writer.back();
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

ostringstream XMLRPCWriter::_buffer [protected, inherited]

Definition at line 298 of file xmlrpc.h.

Referenced by XMLRPCWriter::flush().

int XMLRPCWriter::_params [protected, inherited]
XMLWriter XMLRPCWriter::_writer [protected, inherited]

The documentation for this struct was generated from the following files: