#include <ulxr_value.h>
Inheritance diagram for ulxr::Double:
Public Member Functions | |
Double () | |
Default constructor for a Double. | |
Double (double d) | |
Constructs a Double. | |
Double (const CppString &s) | |
Constructs a Double. | |
virtual | ~Double () |
Destroys the Value. | |
double | getDouble () const |
Returns the current value. | |
void | setDouble (const double newval) |
Sets a new content. | |
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. | |
static bool | setScientificMode (bool scientific) |
Switches the conversion mode for double values. | |
Private Attributes | |
double | val |
Static Private Attributes | |
static bool | scientific |
The range of double values is system dependent as far as I know but should at least cover a "double" in C.
Definition at line 733 of file ulxr_value.h.
ulxr::Double::Double | ( | ) |
ulxr::Double::Double | ( | double | d | ) |
Constructs a Double.
d | value for the construction |
Definition at line 812 of file ulxr_value.cpp.
ulxr::Double::Double | ( | const CppString & | s | ) |
Constructs a Double.
s | value for the construction as number string |
Definition at line 824 of file ulxr_value.cpp.
References ulxr::getLatin1(), and val.
ulxr::Double::~Double | ( | ) | [virtual] |
double ulxr::Double::getDouble | ( | ) | const |
Returns the current value.
Definition at line 907 of file ulxr_value.cpp.
References ulxr::RpcDouble, and ULXR_ASSERT_RPCTYPE.
void ulxr::Double::setDouble | ( | const double | newval | ) |
Sets a new content.
newval | the new content |
Definition at line 914 of file ulxr_value.cpp.
References ulxr::RpcDouble, and ULXR_ASSERT_RPCTYPE.
ValueBase * ulxr::Double::cloneValue | ( | ) | const [virtual] |
Creates a copy of the actual object.
Implements ulxr::ValueBase.
Definition at line 831 of file ulxr_value.cpp.
References ulxr::RpcDouble, and ULXR_ASSERT_RPCTYPE.
CppString ulxr::Double::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 838 of file ulxr_value.cpp.
References ulxr::RpcDouble, and ULXR_ASSERT_RPCTYPE.
CppString ulxr::Double::getValueName | ( | ) | [static] |
Returns the xml name of the Value.
Definition at line 845 of file ulxr_value.cpp.
References ULXR_PCHAR.
std::string ulxr::Double::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 859 of file ulxr_value.cpp.
References ulxr::ApplicationError, ulxr::getWbXmlString(), ulxr::RpcDouble, ULXR_ASSERT_RPCTYPE, ULXR_GET_STRING, ulxr_i18n, ULXR_PCHAR, ulxr_snprintf, ulxr::ValueParserWb::wbToken_Double, ulxr::ValueParserWb::wbToken_Value, and ulxr::WbXmlParser::wbxml_END.
CppString ulxr::Double::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 884 of file ulxr_value.cpp.
References ulxr::ApplicationError, ulxr::getXmlIndent(), ulxr::RpcDouble, ULXR_ASSERT_RPCTYPE, ULXR_GET_STRING, ulxr_i18n, ULXR_PCHAR, and ulxr_snprintf.
bool ulxr::Double::setScientificMode | ( | bool | scientific | ) | [static] |
Switches the conversion mode for double values.
Large numbers create large strings for the number without necessarily increasing the accuracy. For that reason it is possible to switch to scientific mode which uses only the significant 15 or 16 digits.
scientific | true: use scientifiy mode like 123.456E-78 |
Definition at line 851 of file ulxr_value.cpp.
double ulxr::Double::val [private] |
bool ulxr::Double::scientific [static, private] |
Definition at line 815 of file ulxr_value.h.