#include <ulxr_value.h>
Inheritance diagram for ulxr::DateTime:
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 ValueBase * | cloneValue () 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 |
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:
19980717T14
:08:55.
Definition at line 1223 of file ulxr_value.h.
ulxr::DateTime::DateTime | ( | ) |
ulxr::DateTime::DateTime | ( | const CppString & | s | ) |
Constructs a DateTime.
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.
tm | value for the construction as time value |
Definition at line 1161 of file ulxr_value.cpp.
References setDateTime().
ulxr::DateTime::~DateTime | ( | ) | [virtual] |
CppString ulxr::DateTime::getDateTime | ( | ) | const |
Returns the 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.
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.
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.
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.
deep | if nested types exist, include them |
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.
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.
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.
indent | current indentation level |
Implements ulxr::ValueBase.
Definition at line 1206 of file ulxr_value.cpp.
References ulxr::getXmlIndent(), ulxr::RpcDateTime, ULXR_ASSERT_RPCTYPE, and ULXR_PCHAR.
CppString ulxr::DateTime::val [private] |
Definition at line 1305 of file ulxr_value.h.