All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pxmlrpc.h File Reference
`#include <ptclib/pxml.h>`
`#include <ptclib/url.h>`

Go to the source code of this file.

## Classes

class | PXMLRPC
class | PXMLRPCBlock
class | PXMLRPCVariableBase
class | PXMLRPCArrayBase
class | PXMLRPCArrayObjectsBase
class | PXMLRPCStructBase

## Macros

#define | PXMLRPC_STRUCT_BEGIN(name)
#define | PXMLRPC_VARIABLE_CLASS(base, type, variable, xmltype, init, extras)
#define | PXMLRPC_VARIABLE_CUSTOM(base, type, variable, xmltype, init, extras)
#define | PXMLRPC_ARRAY_CUSTOM(base, arraytype, basetype, variable, xmltype, par, extras)
#define | PXMLRPC_STRUCT_END() };
#define | PXMLRPC_VARIABLE(base, type, variable, xmltype) PXMLRPC_VARIABLE_CUSTOM(base, type, variable, xmltype, ;, ;)
#define | PXMLRPC_VARIABLE_INIT(base, type, variable, xmltype, init) PXMLRPC_VARIABLE_CUSTOM(base, type, variable, xmltype, instance=init;, ;)
#define | PXMLRPC_STRING(base, type, variable) PXMLRPC_VARIABLE(base, type, variable, "string")
#define | PXMLRPC_STRING_INIT(base, type, variable, init) PXMLRPC_VARIABLE_INIT(base, type, variable, "string", init)
#define | PXMLRPC_INTEGER(base, type, variable) PXMLRPC_VARIABLE(base, type, variable, "int")
#define | PXMLRPC_INTEGER_INIT(base, type, variable, init) PXMLRPC_VARIABLE_INIT(base, type, variable, "int", init)
#define | PXMLRPC_BOOLEAN(base, type, variable) PXMLRPC_VARIABLE(base, type, variable, "boolean")
#define | PXMLRPC_BOOLEAN_INIT(base, type, variable, init) PXMLRPC_VARIABLE_INIT(base, type, variable, "boolean", init)
#define | PXMLRPC_DOUBLE(base, type, variable) PXMLRPC_VARIABLE(base, type, variable, "double")
#define | PXMLRPC_DOUBLE_INIT(base, type, variable, init) PXMLRPC_VARIABLE_INIT(base, type, variable, "double", init)
#define | PXMLRPC_DATETIME(base, type, variable)
#define | PXMLRPC_BINARY(base, type, variable)
#define | PXMLRPC_STRUCT(base, type, variable)
#define | PXMLRPC_ARRAY(base, arraytype, basetype, variable, xmltype)
#define | PXMLRPC_ARRAY_STRING(base, arraytype, basetype, variable) PXMLRPC_ARRAY(base, arraytype, basetype, variable, "string")
#define | PXMLRPC_ARRAY_INTEGER(base, type, variable)
#define | PXMLRPC_ARRAY_DOUBLE(base, type, variable)
#define | PXMLRPC_ARRAY_STRUCT(base, type, variable)
#define | PXMLRPC_FUNC_NOARG_NOREPLY(name) PBoolean name() { return MakeRequest(#name); }
#define | PXMLRPC_FUNC_SINGLE_ARG(name, vartype, argtype)
#define | PXMLRPC_FUNC_MULTI_ARGS(name) PXMLRPC_STRUCT_BEGIN(name##_in)
#define | PXMLRPC_FUNC_MULTI_REPLY(name) }; PXMLRPC_STRUCT_BEGIN(name##_out)
#define | PXMLRPC_FUNC_NO_ARGS(name)
#define | PXMLRPC_FUNC_STRUCT_ARG(name)
#define | PXMLRPC_FUNC_NORM_ARGS(name)

## Macro Definition Documentation

#define PXMLRPC_ARRAY | ( |  | base,
|  |  | arraytype,
|  |  | basetype,
|  |  | variable,
|  |  | xmltype
| ) |  |

Value:
PXMLRPC_ARRAY_CUSTOM(base, arraytype, basetype, variable, xmltype, PXMLRPCArrayObjectsBase, \
PObject * CreateObject() const { return new basetype; })
PXMLRPC_ARRAY_CUSTOM
#define PXMLRPC_ARRAY_CUSTOM(base, arraytype, basetype, variable, xmltype, par, extras)
Definition: pxmlrpc.h:318
PXMLRPCArrayObjectsBase
Definition: pxmlrpc.h:246
PObject
Ultimate parent class for all objects in the class library.
Definition: object.h:1118

#define PXMLRPC_ARRAY_CUSTOM | ( |  | base,
|  |  | arraytype,
|  |  | basetype,
|  |  | variable,
|  |  | xmltype,
|  |  | par,
|  |  | extras
| ) |  |

Value:
public: arraytype variable; \
private: struct PXMLRPCVar_##variable : public par { \
PXMLRPCVar_##variable() \
: par(((base &)base::GetInitialiser()).variable, #variable, xmltype), \
instance((arraytype &)array) \
{ } \
extras \
arraytype & instance; \
} pxmlrpcvar_##variable

#define PXMLRPC_ARRAY_DOUBLE | ( |  | base,
|  |  | type,
|  |  | variable
| ) |  |

Value:
PXMLRPC_ARRAY_CUSTOM(base, PScalarArray<type>, type, variable, "double", PXMLRPCArrayBase, \
PString ToString(PINDEX i) const { return psprintf("%f", instance[i]); } \
void FromString(PINDEX i, const PString & str) { instance[i] = (type)str.AsReal(); })
PXMLRPC_ARRAY_CUSTOM
#define PXMLRPC_ARRAY_CUSTOM(base, arraytype, basetype, variable, xmltype, par, extras)
Definition: pxmlrpc.h:318
PXMLRPCArrayBase
Definition: pxmlrpc.h:228
PString
The character string class.
Definition: pstring.h:108
PScalarArray
This template class maps the PAbstractArray to a specific element type.
Definition: array.h:502
PString::AsReal
double AsReal() const
Convert the string to a floating point number.
psprintf
PString psprintf(const char *fmt,...)
The same as the standard C snprintf(fmt, 1000, ...), but returns a PString instead of a const char *...

#define PXMLRPC_ARRAY_INTEGER | ( |  | base,
|  |  | type,
|  |  | variable
| ) |  |

Value:
PXMLRPC_ARRAY_CUSTOM(base, PScalarArray<type>, type, variable, "int", PXMLRPCArrayBase, \
PString ToString(PINDEX i) const { return PString(instance[i]); } \
void FromString(PINDEX i, const PString & str) { instance[i] = (type)str.AsInteger(); })
PString::AsInteger
long AsInteger(unsigned base=10) const
Convert the string to an integer value using the specified number base.
PXMLRPC_ARRAY_CUSTOM
#define PXMLRPC_ARRAY_CUSTOM(base, arraytype, basetype, variable, xmltype, par, extras)
Definition: pxmlrpc.h:318
PXMLRPCArrayBase
Definition: pxmlrpc.h:228
PString
The character string class.
Definition: pstring.h:108
PScalarArray
This template class maps the PAbstractArray to a specific element type.
Definition: array.h:502

#define PXMLRPC_ARRAY_STRING | ( |  | base,
|  |  | arraytype,
|  |  | basetype,
|  |  | variable
| ) |  | PXMLRPC_ARRAY(base, arraytype, basetype, variable, "string")

#define PXMLRPC_ARRAY_STRUCT | ( |  | base,
|  |  | type,
|  |  | variable
| ) |  |

Value:
PXMLRPC_ARRAY_CUSTOM(base, PArray<type>, type, variable, "struct", PXMLRPCArrayObjectsBase, \
PXMLRPCStructBase * GetStruct(PINDEX i) const { return &instance[i]; } \
PObject * CreateObject() const { return new type; })
PXMLRPCStructBase
Definition: pxmlrpc.h:264
PXMLRPC_ARRAY_CUSTOM
#define PXMLRPC_ARRAY_CUSTOM(base, arraytype, basetype, variable, xmltype, par, extras)
Definition: pxmlrpc.h:318
PArray
This template class maps the PArrayObjects to a specific object type.
Definition: array.h:1024
PXMLRPCArrayObjectsBase
Definition: pxmlrpc.h:246

#define PXMLRPC_BINARY | ( |  | base,
|  |  | type,
|  |  | variable
| ) |  |

Value:
PXMLRPC_VARIABLE_CUSTOM(base, type, variable, "base64", ;, \
PString ToString(PINDEX) const { return ToBase64(instance); } \
void FromString(PINDEX, const PString & str) { FromBase64(str, instance); } )
PXMLRPC_VARIABLE_CUSTOM
#define PXMLRPC_VARIABLE_CUSTOM(base, type, variable, xmltype, init, extras)
Definition: pxmlrpc.h:314
PString
The character string class.
Definition: pstring.h:108

#define PXMLRPC_BOOLEAN | ( |  | base,
|  |  | type,
|  |  | variable
| ) |  | PXMLRPC_VARIABLE(base, type, variable, "boolean")

#define PXMLRPC_BOOLEAN_INIT | ( |  | base,
|  |  | type,
|  |  | variable,
|  |  | init
| ) |  | PXMLRPC_VARIABLE_INIT(base, type, variable, "boolean", init)

#define PXMLRPC_DATETIME | ( |  | base,
|  |  | type,
|  |  | variable
| ) |  |

Value:
PXMLRPC_VARIABLE_CUSTOM(base, type, variable, "dateTime.iso8601", ;, \
PString ToString(PINDEX) const { return instance.AsString(PTime::ShortISO8601); } )
PXMLRPC_VARIABLE_CUSTOM
#define PXMLRPC_VARIABLE_CUSTOM(base, type, variable, xmltype, init, extras)
Definition: pxmlrpc.h:314
PTime::ShortISO8601
Short form ISO standard format. (eg. 20110209T111108Z)
Definition: ptime.h:405

#define PXMLRPC_DOUBLE | ( |  | base,
|  |  | type,
|  |  | variable
| ) |  | PXMLRPC_VARIABLE(base, type, variable, "double")

#define PXMLRPC_DOUBLE_INIT | ( |  | base,
|  |  | type,
|  |  | variable,
|  |  | init
| ) |  | PXMLRPC_VARIABLE_INIT(base, type, variable, "double", init)

#define PXMLRPC_FUNC_MULTI_ARGS | ( |  | name | ) | PXMLRPC_STRUCT_BEGIN(name##_in)

#define PXMLRPC_FUNC_MULTI_REPLY | ( |  | name | ) | }; PXMLRPC_STRUCT_BEGIN(name##_out)

#define PXMLRPC_FUNC_NO_ARGS | ( |  | name | ) |

Value:
}; \
PBoolean name(name##_out & reply) \
{ return MakeRequest(#name, name##_in(), reply); }
PBoolean
BOOL PBoolean
Definition: object.h:102

#define PXMLRPC_FUNC_NOARG_NOREPLY | ( |  | name | ) | PBoolean name() { return MakeRequest(#name); }

#define PXMLRPC_FUNC_NORM_ARGS | ( |  | name | ) |

Value:
}; \
PBoolean name(const name##_in & args, name##_out & reply) \
{ return MakeRequest(#name, args, reply); }
PBoolean
BOOL PBoolean
Definition: object.h:102

#define PXMLRPC_FUNC_SINGLE_ARG | ( |  | name,
|  |  | vartype,
|  |  | argtype
| ) |  |

Value:
class name##_in : public PXMLRPCStructBase { \
public: name##_in(const argtype & var) : variable(var) { EndConstructor(); } \
vartype(name##_in, argtype, variable);
PXMLRPCStructBase
Definition: pxmlrpc.h:264
PXMLRPCStructBase::EndConstructor
void EndConstructor()

#define PXMLRPC_FUNC_STRUCT_ARG | ( |  | name | ) |

Value:
}; \
class name##_in_carrier : public PXMLRPCStructBase { \
public: name##_in_carrier(const name##_in & var) : variable(var) { EndConstructor(); } \
private: struct var_class : public PXMLRPCVariableBase { \
var_class(const name##_in & var) \
: PXMLRPCVariableBase("variable", "struct"), instance(var) { } \
virtual void PrintOn (ostream & s) const { s << instance; } \
virtual PXMLRPCStructBase * GetStruct(PINDEX) const { return (PXMLRPCStructBase *)&instance; } \
virtual void Copy(const PXMLRPCVariableBase &) { } \
const name##_in & instance; \
} variable; \
}; \
PBoolean name(const name##_in & args, name##_out & reply) \
{ return MakeRequest(#name, name##_in_carrier(args), reply); }
PXMLRPCVariableBase::PXMLRPCVariableBase
PXMLRPCVariableBase(const char *name, const char *type=NULL)
PXMLRPCStructBase
Definition: pxmlrpc.h:264
PBoolean
BOOL PBoolean
Definition: object.h:102
PXMLRPCVariableBase::Copy
virtual void Copy(const PXMLRPCVariableBase &other)=0
PXMLRPCVariableBase
Definition: pxmlrpc.h:199
PXMLRPCVariableBase::GetStruct
virtual PXMLRPCStructBase * GetStruct(PINDEX i) const
PObject::PrintOn
virtual void PrintOn(ostream &strm) const
Output the contents of the object to the stream.

#define PXMLRPC_INTEGER | ( |  | base,
|  |  | type,
|  |  | variable
| ) |  | PXMLRPC_VARIABLE(base, type, variable, "int")

#define PXMLRPC_INTEGER_INIT | ( |  | base,
|  |  | type,
|  |  | variable,
|  |  | init
| ) |  | PXMLRPC_VARIABLE_INIT(base, type, variable, "int", init)

#define PXMLRPC_STRING | ( |  | base,
|  |  | type,
|  |  | variable
| ) |  | PXMLRPC_VARIABLE(base, type, variable, "string")

#define PXMLRPC_STRING_INIT | ( |  | base,
|  |  | type,
|  |  | variable,
|  |  | init
| ) |  | PXMLRPC_VARIABLE_INIT(base, type, variable, "string", init)

#define PXMLRPC_STRUCT | ( |  | base,
|  |  | type,
|  |  | variable
| ) |  |

Value:
PXMLRPC_VARIABLE_CUSTOM(base, type, variable, "struct", ;, \
PXMLRPCStructBase * GetStruct(PINDEX) const { return &instance; } )
PXMLRPC_VARIABLE_CUSTOM
#define PXMLRPC_VARIABLE_CUSTOM(base, type, variable, xmltype, init, extras)
Definition: pxmlrpc.h:314

#define PXMLRPC_STRUCT_BEGIN | ( |  | name | ) |

Value:
class name : public PXMLRPCStructBase { \
public: name() { EndConstructor(); } \
public: name(const name & other) { EndConstructor(); operator=(other); } \
public: name & operator=(const name & other) { PXMLRPCStructBase::operator=(other); return *this; }
PXMLRPCStructBase
Definition: pxmlrpc.h:264
PXMLRPCStructBase::EndConstructor
void EndConstructor()
PXMLRPCStructBase::operator=
PXMLRPCStructBase & operator=(const PXMLRPCStructBase &)

#define PXMLRPC_STRUCT_END | ( |  | ) | };

#define PXMLRPC_VARIABLE | ( |  | base,
|  |  | type,
|  |  | variable,
|  |  | xmltype
| ) |  | PXMLRPC_VARIABLE_CUSTOM(base, type, variable, xmltype, ;, ;)

#define PXMLRPC_VARIABLE_CLASS | ( |  | base,
|  |  | type,
|  |  | variable,
|  |  | xmltype,
|  |  | init,
|  |  | extras
| ) |  |

Value:
private: struct PXMLRPCVar_##variable : public PXMLRPCVariableBase { \
PXMLRPCVar_##variable() \
: PXMLRPCVariableBase(#variable, xmltype), \
instance(((base &)base::GetInitialiser()).variable) \
{ init } \
virtual void PrintOn (ostream & s) const { s << instance; } \
virtual void ReadFrom(istream & s) { s >> instance; } \
virtual void Copy(const PXMLRPCVariableBase & other) \
{ instance = ((PXMLRPCVar_##variable &)other).instance; } \
extras \
type & instance; \
} pxmlrpcvar_##variable
PXMLRPCVariableBase::PXMLRPCVariableBase
PXMLRPCVariableBase(const char *name, const char *type=NULL)
PObject::ReadFrom
virtual void ReadFrom(istream &strm)
Input the contents of the object from the stream.
PXMLRPCVariableBase::Copy
virtual void Copy(const PXMLRPCVariableBase &other)=0
PXMLRPCVariableBase
Definition: pxmlrpc.h:199
PObject::PrintOn
virtual void PrintOn(ostream &strm) const
Output the contents of the object to the stream.

#define PXMLRPC_VARIABLE_CUSTOM | ( |  | base,
|  |  | type,
|  |  | variable,
|  |  | xmltype,
|  |  | init,
|  |  | extras
| ) |  |

Value:
public: type variable; \
PXMLRPC_VARIABLE_CLASS(base, type, variable, xmltype, init, extras)
PXMLRPC_VARIABLE_CLASS
#define PXMLRPC_VARIABLE_CLASS(base, type, variable, xmltype, init, extras)
Definition: pxmlrpc.h:300

#define PXMLRPC_VARIABLE_INIT | ( |  | base,
|  |  | type,
|  |  | variable,
|  |  | xmltype,
|  |  | init
| ) |  | PXMLRPC_VARIABLE_CUSTOM(base, type, variable, xmltype, instance=init;, ;)