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

Implementation of a date and time value. More...

#include <ulxr_value.h>

Inheritance diagram for ulxr::DateTime:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DateTime ()
 Default constructor for a DateTime.
 DateTime (const CppString &s)
 Constructs a DateTime.
 DateTime (const ulxr_time_t &tm)
 Constructs a DateTime.
virtual ~DateTime ()
 Destroys the Value.
CppString getDateTime () const
 Returns the current value.
void setDateTime (const CppString &newval)
 Sets a new content.
void setDateTime (const ulxr_time_t &tm, bool add_dash=false, bool add_colon=true)
 Sets a new content from a std::time_t.
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 date and time value.

The format is according to ISO8601 and must currently be done on the users side as this class only provides transportation.

Though XmlRpc uses the ISO8601 specification, not all detail are intended to be supported. Time zones, milliseconds, abbreviations and mybe more are omited. Only the 17 bytes from a value like the following should be considered implemented:

Definition at line 1223 of file ulxr_value.h.


Constructor & Destructor Documentation

ulxr::DateTime::DateTime (  ) 

Default constructor for a DateTime.

Definition at line 1148 of file ulxr_value.cpp.

ulxr::DateTime::DateTime ( const CppString s  ) 

Constructs a DateTime.

Parameters:
s value for the construction as string

Definition at line 1154 of file ulxr_value.cpp.

ulxr::DateTime::DateTime ( const ulxr_time_t &  tm  ) 

Constructs a DateTime.

Uses defaults from setDateTime as as decribed in the example in the XMLRPC spec.

Parameters:
tm value for the construction as time value

Definition at line 1161 of file ulxr_value.cpp.

References setDateTime().

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

Destroys the Value.

Definition at line 1168 of file ulxr_value.cpp.


Member Function Documentation

CppString ulxr::DateTime::getDateTime (  )  const

Returns the current value.

Returns:
current value

Definition at line 1217 of file ulxr_value.cpp.

References ulxr::RpcDateTime, and ULXR_ASSERT_RPCTYPE.

void ulxr::DateTime::setDateTime ( const CppString newval  ) 

Sets a new content.

Parameters:
newval the new content

Definition at line 1267 of file ulxr_value.cpp.

References ulxr::RpcDateTime, and ULXR_ASSERT_RPCTYPE.

Referenced by DateTime().

void ulxr::DateTime::setDateTime ( const ulxr_time_t &  tm,
bool  add_dash = false,
bool  add_colon = true 
)

Sets a new content from a std::time_t.

Since the XMLRPC spec says nothing special about the format there is an option to add "-" and ":" to the date string as defined by ISO8601. The default is to omit dashes and add colons as is decribed in the example in the XMLRPC spec: 19980717T14:08:55.

Parameters:
tm value for the construction as time value
add_dash add the dashes in the date part
add_colon add the colons in the time part
tm value for the construction as time value

Definition at line 1238 of file ulxr_value.cpp.

References ulxr::localtimeMutex, ulxr::padded(), ulxr_localtime, ULXR_PCHAR, and ulxr_tm.

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

Creates a copy of the actual object.

Returns:
pointer to the copy

Implements ulxr::ValueBase.

Definition at line 1173 of file ulxr_value.cpp.

References ulxr::RpcDateTime, and ULXR_ASSERT_RPCTYPE.

CppString ulxr::DateTime::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 1180 of file ulxr_value.cpp.

References ulxr::RpcDateTime, and ULXR_ASSERT_RPCTYPE.

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

Returns the xml name of the Value.

Returns:
value name

Definition at line 1187 of file ulxr_value.cpp.

References ULXR_PCHAR.

std::string ulxr::DateTime::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 1193 of file ulxr_value.cpp.

References ulxr::getWbXmlString(), ulxr::RpcDateTime, ULXR_ASSERT_RPCTYPE, ulxr::ValueParserWb::wbToken_Date, ulxr::ValueParserWb::wbToken_Value, and ulxr::WbXmlParser::wbxml_END.

CppString ulxr::DateTime::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 1206 of file ulxr_value.cpp.

References ulxr::getXmlIndent(), ulxr::RpcDateTime, ULXR_ASSERT_RPCTYPE, and ULXR_PCHAR.


Member Data Documentation

CppString ulxr::DateTime::val [private]

Definition at line 1305 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