ulxr::RpcString Class Reference
[Value types in an XML-RPC call]

Implementation of a string value. More...

#include <ulxr_value.h>

Inheritance diagram for ulxr::RpcString:

Inheritance graph
[legend]
Collaboration diagram for ulxr::RpcString:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RpcString ()
 Default constructor for an RpcString.
 RpcString (const Cpp16BitString &s)
 Constructs an RpcString.
 RpcString (const Cpp8BitString &s)
 Constructs an RpcString.
virtual ~RpcString ()
 Destroys the Value.
void setString (const Cpp16BitString &newval)
 Sets a new content.
void setString (const Cpp8BitString &newval)
 Sets a new content.
CppString getString () const
 Returns the current value encoded in UTF8.
Cpp16BitString getUnicodeString () const
 Returns the current value as Unicode string.
virtual ValueBasecloneValue () const
 Creates a copy of the actual object.
virtual CppString getSignature (bool deep=false) const
 Returns the signature of value.
virtual std::string getWbXml () const
 Returns the call as binary xml string.
virtual CppString getXml (int indent=0) const
 Returns the value as xml string.

Static Public Member Functions

static CppString getValueName ()
 Returns the xml name of the Value.

Private Attributes

CppString val

Detailed Description

Implementation of a string value.

The content is usually what you might call "text" and always encoded in Unicode to avoid misinterpretation due to unknown and variing charsets. The internal storage format is either directly unicode (std::wstring) or UTF8 when compiled with 8bit characters in non-unicode mode.

Attention:
You must convert from your local encodings, for example with libiconv.

Definition at line 1089 of file ulxr_value.h.


Constructor & Destructor Documentation

ulxr::RpcString::RpcString (  ) 

Default constructor for an RpcString.

Definition at line 924 of file ulxr_value.cpp.

ulxr::RpcString::RpcString ( const Cpp16BitString s  ) 

Constructs an RpcString.

Parameters:
s value for the construction as Unicode string

Definition at line 944 of file ulxr_value.cpp.

References setString().

ulxr::RpcString::RpcString ( const Cpp8BitString s  ) 

Constructs an RpcString.

Parameters:
s value for the construction as UTF8 string

Definition at line 930 of file ulxr_value.cpp.

References setString().

ulxr::RpcString::~RpcString (  )  [virtual]

Destroys the Value.

Definition at line 937 of file ulxr_value.cpp.


Member Function Documentation

void ulxr::RpcString::setString ( const Cpp16BitString newval  ) 

Sets a new content.

Parameters:
newval the new content in Unicode

Definition at line 1046 of file ulxr_value.cpp.

References ulxr::RpcStrType, and ULXR_ASSERT_RPCTYPE.

Referenced by RpcString().

void ulxr::RpcString::setString ( const Cpp8BitString newval  ) 

Sets a new content.

Parameters:
newval the new content in UTF8

Definition at line 1033 of file ulxr_value.cpp.

References ulxr::getUnicode(), ulxr::RpcStrType, and ULXR_ASSERT_RPCTYPE.

CppString ulxr::RpcString::getString (  )  const

Returns the current value encoded in UTF8.

Returns:
current value

Definition at line 996 of file ulxr_value.cpp.

References ulxr::RpcStrType, and ULXR_ASSERT_RPCTYPE.

Referenced by ulxr::MethodResponseParserBase::getMethodResponse(), ulxr::Dispatcher::system_methodHelp(), and ulxr::Dispatcher::system_methodSignature().

Cpp16BitString ulxr::RpcString::getUnicodeString (  )  const

Returns the current value as Unicode string.

Returns:
current value

Definition at line 1005 of file ulxr_value.cpp.

References ulxr::RpcStrType, ULXR_ASSERT_RPCTYPE, and ulxr::utf8ToUnicode().

ValueBase * ulxr::RpcString::cloneValue (  )  const [virtual]

Creates a copy of the actual object.

Returns:
pointer to the copy

Implements ulxr::ValueBase.

Definition at line 952 of file ulxr_value.cpp.

References ulxr::RpcStrType, and ULXR_ASSERT_RPCTYPE.

CppString ulxr::RpcString::getSignature ( bool  deep = false  )  const [virtual]

Returns the signature of value.

The signature consists of its type name.

Parameters:
deep if nested types exist, include them
Returns:
The signature

Implements ulxr::ValueBase.

Definition at line 959 of file ulxr_value.cpp.

References ulxr::RpcStrType, and ULXR_ASSERT_RPCTYPE.

CppString ulxr::RpcString::getValueName (  )  [static]

Returns the xml name of the Value.

Returns:
value name

Definition at line 966 of file ulxr_value.cpp.

References ULXR_PCHAR.

std::string ulxr::RpcString::getWbXml (  )  const [virtual]

Returns the call as binary xml string.

The method call is converted to a wbxml sequence. It is prepended with the necessary xml procession instruction with version and encoding set to UTF-8.

Returns:
The wbxml content

Implements ulxr::ValueBase.

Definition at line 972 of file ulxr_value.cpp.

References ulxr::getWbXmlString(), ulxr::RpcStrType, ULXR_ASSERT_RPCTYPE, ulxr::ValueParserWb::wbToken_String, ulxr::ValueParserWb::wbToken_Value, and ulxr::WbXmlParser::wbxml_END.

CppString ulxr::RpcString::getXml ( int  indent = 0  )  const [virtual]

Returns the value as xml string.

The content and its type name is converted to an xml text. The structure of the text is indented to facilitate easy reading of larger blocks.

Parameters:
indent current indentation level
Returns:
The xml content

Implements ulxr::ValueBase.

Definition at line 985 of file ulxr_value.cpp.

References ulxr::getXmlIndent(), ulxr::RpcStrType, ULXR_ASSERT_RPCTYPE, ULXR_PCHAR, and ulxr::xmlEscape().


Member Data Documentation

CppString ulxr::RpcString::val [private]

Definition at line 1205 of file ulxr_value.h.


The documentation for this class was generated from the following files:
Generated on Sun Aug 19 20:09:11 2007 for ulxmlrpcpp by  doxygen 1.5.1