CGUIValue stores a single value in one specific type. More...
#include <GUIValue.h>
Public Types | |
enum | GUIValue_t { EC_INT , EC_FLOAT , EC_STRING , EC_HEX , EC_BOOL , EC_BYTE , EC_UBYTE , EC_CHAR , EC_WCHAR , EC_SHORT , EC_USHORT , EC_UINT , EC_VALUE , EC_FIXED , EC_POINTER } |
This enumeration indicates the type (format) of the CGUIValue. | |
Public Member Functions | |
CGUIValue () | |
CGUIValue (const double dValue) | |
CGUIValue (const eC_Bool bValue) | |
CGUIValue (const eC_Byte bValue) | |
CGUIValue (const eC_Char *pcStringValue) | |
CGUIValue (const eC_Char cValue) | |
CGUIValue (const eC_Int iValue) | |
CGUIValue (const eC_Short sValue) | |
CGUIValue (const eC_String &StringValue, const GUIValue_t &eType=EC_STRING) | |
CGUIValue (const eC_UByte ubValue) | |
CGUIValue (const eC_UInt uiValue) | |
CGUIValue (const eC_UTF16 wcValue) | |
CGUIValue (const int uiValue) | |
CGUIValue (const unsigned int uiValue) | |
CGUIValue (void *const PointerValue) | |
eC_Bool | ConvertTo (const GUIValue_t &eType) |
GUIValue_t | GetType () const |
eC_Bool | IsConvertibleTo (const GUIValue_t &eType) const |
CGUIValue & | operator= (const CGUIValue &Value) |
virtual void | ReadFromStream () |
eC_Bool | ToBool () const |
eC_Byte | ToByte () const |
eC_Char | ToChar () const |
eC_Fixed | ToFix () const |
eC_Float | ToFloat () const |
eC_Int | ToInt () const |
void * | ToPointer () const |
eC_Short | ToShort () const |
eC_String | ToString () const |
eC_UByte | ToUByte () const |
eC_UInt | ToUInt () const |
eC_UShort | ToUShort () const |
eC_Value | ToValue () const |
eC_UTF16 | ToWChar () const |
virtual void | WriteToStream (const eC_Bool bWriteClassID=false) |
![]() | |
const eC_String & | GetXMLTag () const |
virtual void | ReadFromStream () |
void | SetXMLTag (const eC_String &kXMLTag) |
virtual void | WriteToStream (const eC_Bool bWriteClassID=false) |
Additional Inherited Members | |
![]() | |
static const eC_Char | XMLTAG_CLASSVERSION [] |
![]() | |
eC_UInt | ReadStreamingHeader (const eC_UInt &uiClassVersion, const eC_UInt &uiClassMinVersion=0) const |
void | WriteStreamingFooter (const eC_Bool &bWriteClassID) const |
void | WriteStreamingHeader (const eC_Bool &bWriteClassID, const eC_Char *const pkClassIDTag, const eC_Int &iClassID, const eC_UInt &uiClassVersion) const |
CGUIValue stores a single value in one specific type.
It provides conversion of the stored value between the supported types and comparison.
For the supported types see GUIValue_t.
CGUIValue::CGUIValue | ( | ) |
Constructs a CGUIValue. The initial value is an integer 0.
CGUIValue::CGUIValue | ( | const eC_Bool | bValue | ) |
Constructs a CGUIValue from boolean.
bValue |
CGUIValue::CGUIValue | ( | const eC_Byte | bValue | ) |
Constructs a CGUIValue from byte.
bValue |
CGUIValue::CGUIValue | ( | const eC_UByte | ubValue | ) |
Constructs a CGUIValue from unsigned byte.
ubValue |
CGUIValue::CGUIValue | ( | const eC_Char | cValue | ) |
Constructs a CGUIValue from character.
cValue |
CGUIValue::CGUIValue | ( | const eC_UTF16 | wcValue | ) |
Constructs a CGUIValue from wide character.
wcValue |
CGUIValue::CGUIValue | ( | const eC_Short | sValue | ) |
Constructs a CGUIValue from short.
sValue |
CGUIValue::CGUIValue | ( | const eC_Int | iValue | ) |
Constructs a CGUIValue from long.
iValue |
CGUIValue::CGUIValue | ( | const eC_UInt | uiValue | ) |
Constructs a CGUIValue from unsigned long.
uiValue |
CGUIValue::CGUIValue | ( | const unsigned int | uiValue | ) |
Constructs a CGUIValue from unsigned integer.
uiValue |
CGUIValue::CGUIValue | ( | const int | uiValue | ) |
Constructs a CGUIValue from integer.
uiValue |
CGUIValue::CGUIValue | ( | const double | dValue | ) |
Constructs a CGUIValue from float. The value is stored as eC_Float, so there is a possible loss of precision.
dValue | The value to construct from |
CGUIValue::CGUIValue | ( | const eC_Char * | pcStringValue | ) |
CGUIValue::CGUIValue | ( | const eC_String & | StringValue, |
const GUIValue_t & | eType = EC_STRING |
||
) |
Constructs a CGUIValue from string. The string format stays unchanged.
StringValue | The value to construct from |
eType |
CGUIValue::CGUIValue | ( | void *const | PointerValue | ) |
Constructs a CGUIValue from pointer.
PointerValue | The value to construct from |
eC_Bool CGUIValue::ConvertTo | ( | const GUIValue_t & | eType | ) |
Converts the current value.
eType | The type to convert to. |
|
inline |
Returns the current type of the stored value. This means that the value has been constructed as or converted to this type and the according To[type] method will not have to convert the value again.
eC_Bool CGUIValue::IsConvertibleTo | ( | const GUIValue_t & | eType | ) | const |
Checks if the current type is convertible to another type. The values are not checked. The check is only done based on the types.
eType | The type to convert to. |
Sets the value and type.
Value | The value to set. |
|
virtual |
eC_Bool CGUIValue::ToBool | ( | ) | const |
Converts the current value to a boolean. All numerical values not equal to zero are true. A string is True if it is equal to ms_TrueString.
eC_Byte CGUIValue::ToByte | ( | ) | const |
Converts the current value to a byte. For characters and strings the string value is converted to integer and then cut to 8 bit value.
eC_Char CGUIValue::ToChar | ( | ) | const |
Converts the current value to a character by converting the current value to an ASCII string (if necessary) and returning the first character.
eC_Fixed CGUIValue::ToFix | ( | ) | const |
Converts the current value to a fix point value. For characters and strings the string value is converted to float and then transformed to fix point representation.
eC_Float CGUIValue::ToFloat | ( | ) | const |
Converts the current value to a float. For characters and strings the string value is converted to float.
eC_Int CGUIValue::ToInt | ( | ) | const |
Converts the current value to a signed integer. For characters and strings the string value is converted to integer and then cut to 32 bit value.
void * CGUIValue::ToPointer | ( | ) | const |
Converts the current value to a void pointer. Everything which is not a pointer returns NULL.
eC_Short CGUIValue::ToShort | ( | ) | const |
Converts the current value to a signed short. For characters and strings the string value is converted to integer and then cut to 16 bit value.
eC_String CGUIValue::ToString | ( | ) | const |
Converts the current value to a string. For characters and strings the string value is converted to float and then transformed to fix point representation.
eC_UByte CGUIValue::ToUByte | ( | ) | const |
Converts the current value to an unsigned byte. For characters and strings the string value is converted to integer and then cut to 8 bit value.
eC_UInt CGUIValue::ToUInt | ( | ) | const |
Converts the current value to an unsigned integer. For characters and strings the string value is converted to integer and then cut to 32 bit value.
eC_UShort CGUIValue::ToUShort | ( | ) | const |
Converts the current value to an unsigned short. For characters and strings the string value is converted to integer and then cut to 16 bit value.
eC_Value CGUIValue::ToValue | ( | ) | const |
Converts the current value to a eC_Value. For characters and strings the string value is converted to float and then transformed to eC_Value.
eC_UTF16 CGUIValue::ToWChar | ( | ) | const |
Converts the current value to a UTF-16 character by converting the current value to an UTF-16 string (if necessary) and returning the first character.
|
virtual |
Writes all object attributes to the streaming file. StreamWriter has to be initialized. Only for use with GUIStreamWriter.
bWriteClassID | This flag is used to select if writing of command class ID, leading and trailing tags is performed. |
Reimplemented from CGUIStreamableObject.