Public Member Functions | Protected Member Functions | Protected Attributes

XMLRPC::XMLRPCWriter Struct Reference

#include <xmlrpc.h>

Inheritance diagram for XMLRPC::XMLRPCWriter:
Inheritance graph
[legend]
Collaboration diagram for XMLRPC::XMLRPCWriter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 XMLRPCWriter ()
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

Detailed Description

Definition at line 288 of file xmlrpc.h.


Constructor & Destructor Documentation

XMLRPC::XMLRPCWriter::XMLRPCWriter (  ) [inline]

Definition at line 290 of file xmlrpc.h.


Member Function Documentation

string XMLRPC::XMLRPCWriter::flush (  )

Definition at line 219 of file xmlrpc.cpp.

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

Referenced by XMLRPC::XMLRPCClient::call().

{
    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 XMLRPC::XMLRPCWriter::write_param ( const XMLRPCArray arr ) [protected]

Definition at line 255 of file xmlrpc.cpp.

References _params, _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 XMLRPC::XMLRPCWriter::write_param ( const XMLRPCStruct str ) [protected]

Definition at line 277 of file xmlrpc.cpp.

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

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

    write_struct(str, "param");
}

Here is the call graph for this function:

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

Definition at line 241 of file xmlrpc.cpp.

References _params, _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 XMLRPC::XMLRPCWriter::write_string_param ( const string &  value ) [protected]

Definition at line 229 of file xmlrpc.cpp.

References _params, _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 XMLRPC::XMLRPCWriter::write_struct ( const XMLRPCStruct str,
const string &  keyword 
) [protected]

Definition at line 287 of file xmlrpc.cpp.

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

Referenced by 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 XMLRPC::XMLRPCWriter::_buffer [protected]

Definition at line 301 of file xmlrpc.h.

Referenced by flush().

Definition at line 303 of file xmlrpc.h.

Referenced by flush(), write_param(), and write_string_param().


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