Guiliani  Version 2.5 revision 7293 (documentation build 13)
CGUIValue Class Reference

CGUIValue stores a single value in one specific type. More...

#include <GUIValue.h>

Inheritance diagram for CGUIValue:

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
 
CGUIValueoperator= (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)
 
- Public Member Functions inherited from CGUIStreamableObject
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 Public Attributes inherited from CGUIStreamableObject
static const eC_Char XMLTAG_CLASSVERSION []
 
- Protected Member Functions inherited from CGUIStreamableObject
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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CGUIValue() [1/15]

CGUIValue::CGUIValue ( )

Constructs a CGUIValue. The initial value is an integer 0.

◆ CGUIValue() [2/15]

CGUIValue::CGUIValue ( const eC_Bool  bValue)

Constructs a CGUIValue from boolean.

Parameters
bValue

◆ CGUIValue() [3/15]

CGUIValue::CGUIValue ( const eC_Byte  bValue)

Constructs a CGUIValue from byte.

Parameters
bValue

◆ CGUIValue() [4/15]

CGUIValue::CGUIValue ( const eC_UByte  ubValue)

Constructs a CGUIValue from unsigned byte.

Parameters
ubValue

◆ CGUIValue() [5/15]

CGUIValue::CGUIValue ( const eC_Char  cValue)

Constructs a CGUIValue from character.

Parameters
cValue

◆ CGUIValue() [6/15]

CGUIValue::CGUIValue ( const eC_UTF16  wcValue)

Constructs a CGUIValue from wide character.

Parameters
wcValue

◆ CGUIValue() [7/15]

CGUIValue::CGUIValue ( const eC_Short  sValue)

Constructs a CGUIValue from short.

Parameters
sValue

◆ CGUIValue() [8/15]

CGUIValue::CGUIValue ( const eC_Int  iValue)

Constructs a CGUIValue from long.

Parameters
iValue

◆ CGUIValue() [9/15]

CGUIValue::CGUIValue ( const eC_UInt  uiValue)

Constructs a CGUIValue from unsigned long.

Parameters
uiValue

◆ CGUIValue() [10/15]

CGUIValue::CGUIValue ( const unsigned int  uiValue)

Constructs a CGUIValue from unsigned integer.

Parameters
uiValue

◆ CGUIValue() [11/15]

CGUIValue::CGUIValue ( const int  uiValue)

Constructs a CGUIValue from integer.

Parameters
uiValue

◆ CGUIValue() [12/15]

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.

Parameters
dValueThe value to construct from

◆ CGUIValue() [13/15]

CGUIValue::CGUIValue ( const eC_Char *  pcStringValue)

Constructs a CGUIValue from c-string. The string is interpreted as ASCII. The type of the constructed CGUIValue is EC_STRING.

Parameters
pcStringValueThe value to construct from

◆ CGUIValue() [14/15]

CGUIValue::CGUIValue ( const eC_String &  StringValue,
const GUIValue_t eType = EC_STRING 
)

Constructs a CGUIValue from string. The string format stays unchanged.

Parameters
StringValueThe value to construct from
eType

◆ CGUIValue() [15/15]

CGUIValue::CGUIValue ( void *const  PointerValue)

Constructs a CGUIValue from pointer.

Parameters
PointerValueThe value to construct from

Member Function Documentation

◆ ConvertTo()

eC_Bool CGUIValue::ConvertTo ( const GUIValue_t eType)

Converts the current value.

Parameters
eTypeThe type to convert to.
Returns
True if the conversion was successful, otherwise False.

◆ GetType()

GUIValue_t CGUIValue::GetType ( ) const
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.

Returns
The current type of this value.

◆ IsConvertibleTo()

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.

Parameters
eTypeThe type to convert to.
Returns
True if the types can be converted.

◆ operator=()

CGUIValue & CGUIValue::operator= ( const CGUIValue Value)

Sets the value and type.

Parameters
ValueThe value to set.
Returns
Reference to the new Value.

◆ ReadFromStream()

virtual void CGUIValue::ReadFromStream ( )
virtual

Reads a CGUIValue object from stream.

See also
CGUIFactory

Reimplemented from CGUIStreamableObject.

◆ ToBool()

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.

Returns
the boolean value.

◆ ToByte()

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.

Returns
the signed byte value.

◆ ToChar()

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.

Returns
The converted value, 0 if the value could not be converted.

◆ ToFix()

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.

Returns
the fix point value.

◆ ToFloat()

eC_Float CGUIValue::ToFloat ( ) const

Converts the current value to a float. For characters and strings the string value is converted to float.

Returns
the float value.

◆ ToInt()

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.

Returns
the signed integer value.

◆ ToPointer()

void * CGUIValue::ToPointer ( ) const

Converts the current value to a void pointer. Everything which is not a pointer returns NULL.

Returns
the pointer.

◆ ToShort()

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.

Returns
the signed short value.

◆ ToString()

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.

Returns
the String representation of the current value.

◆ ToUByte()

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.

Returns
the unsigned byte value.

◆ ToUInt()

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.

Returns
the unsigned integer value.

◆ ToUShort()

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.

Returns
the unsigned short value.

◆ ToValue()

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.

Returns
the eC_Value.

◆ ToWChar()

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.

Returns
The converted value, 0 if the value could not be converted.

◆ WriteToStream()

virtual void CGUIValue::WriteToStream ( const eC_Bool  bWriteClassID = false)
virtual

Writes all object attributes to the streaming file. StreamWriter has to be initialized. Only for use with GUIStreamWriter.

Parameters
bWriteClassIDThis flag is used to select if writing of command class ID, leading and trailing tags is performed.
See also
CGUIStreamWriter

Reimplemented from CGUIStreamableObject.


The documentation for this class was generated from the following file: