#include <xmlrpc.h>


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 |
Definition at line 285 of file xmlrpc.h.
| XMLRPCWriter::XMLRPCWriter | ( | ) | [inline] |
| string XMLRPCWriter::flush | ( | ) |
Definition at line 216 of file xmlrpc.cpp.
References _buffer, _params, _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();
}


| void XMLRPCWriter::write_param | ( | const XMLRPCArray & | arr ) | [protected] |
Definition at line 252 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();
}

| void XMLRPCWriter::write_param | ( | const XMLRPCStruct & | str ) | [protected] |
Definition at line 274 of file xmlrpc.cpp.
References _params, _writer, XMLStorage::XMLWriter::create(), and write_struct().
{
if (!_params++)
_writer.create("params");
write_struct(str, "param");
}

| void XMLRPCWriter::write_param | ( | const string & | type, |
| const string & | value | ||
| ) | [protected] |
Definition at line 238 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();
}

| void XMLRPCWriter::write_string_param | ( | const string & | value ) | [protected] |
Definition at line 226 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();
}

| void XMLRPCWriter::write_struct | ( | const XMLRPCStruct & | str, |
| const string & | keyword | ||
| ) | [protected] |
Definition at line 284 of file xmlrpc.cpp.
References _writer, XMLStorage::XMLWriter::back(), XMLStorage::XMLWriter::create(), and XMLStorage::XMLWriter::set_content().
Referenced by XMLRPCResponse::set_failure(), and 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();
}


ostringstream XMLRPCWriter::_buffer [protected] |
int XMLRPCWriter::_params [protected] |
Definition at line 300 of file xmlrpc.h.
Referenced by flush(), write_param(), and write_string_param().
XMLWriter XMLRPCWriter::_writer [protected] |
Definition at line 299 of file xmlrpc.h.
Referenced by flush(), XMLRPCResponse::init(), XMLRPCCall::init(), write_param(), write_string_param(), and write_struct().
1.7.2