Classes | Public Types | Public Member Functions

zeus::TZSimpleVariant Class Reference

#include <ZSimpleVariant.hpp>

List of all members.

Classes

union  TZSimpleVariantData

Public Types

enum  EDataType {
  etEmpty = -1, etFloat = 0, etInt = 1, etUint32 = 2,
  etBool = 3, etString = 4, etUint8 = 5, etUint16 = 6
}

Public Member Functions

 TZSimpleVariant ()
 TZSimpleVariant (int iValue)
 TZSimpleVariant (Int iValue)
 TZSimpleVariant (unsigned int uiValue)
 TZSimpleVariant (Uint8 ucValue)
 TZSimpleVariant (Uint16 usValue)
 TZSimpleVariant (Uint32 ulValue)
 TZSimpleVariant (const Float &rfValue)
 TZSimpleVariant (const IString &rstrValue)
 TZSimpleVariant (const TString &rstrValue)
 TZSimpleVariant (const wchar_t *pValue)
 TZSimpleVariant (bool bValue)
 TZSimpleVariant (const TZSimpleVariant &rInpar)
virtual ~TZSimpleVariant ()
void assign (const TZSimpleVariant &rInpar)
void assignInt (Int iValue)
void assignUint8 (Uint8 ucValue)
void assignUint16 (Uint16 usValue)
void assignUint32 (Uint32 ulValue)
void assignBool (bool bValue)
void assignFloat (const Float &rfValue)
void assignString (const IString &rstrValue)
bool convert (EDataType eNewDataType)
bool equals (const TZSimpleVariant &rInpar) const
bool equalsInt (Int iValue) const
bool equalsUint (Uint uiValue) const
bool equalsBool (bool bValue) const
bool equalsFloat (const Float &rfValue) const
bool equalsString (const IString &rstrValue) const
EDataType getDataType () const
const TZSimpleVariantDatagetData () const
TZSimpleVariantDatagetData ()
Int toInt (bool *pbError=NULL) const
Int8 toInt8 (bool *pbError=NULL) const
Int16 toInt16 (bool *pbError=NULL) const
Int32 toInt32 (bool *pbError=NULL) const
Int toIntWithSign (bool *pbError=NULL) const
Uint toUint (bool *pbError=NULL) const
bool toBool (bool *pbError=NULL) const
Float toFloat (bool *pbError=NULL) const
Float toFloatWithSign (bool *pbError=NULL) const
TString toString () const
TZSimpleVariantoperator= (const TZSimpleVariant &rInpar)
TZSimpleVariantoperator= (int iValue)
TZSimpleVariantoperator= (Int iValue)
TZSimpleVariantoperator= (Uint8 uiValue)
TZSimpleVariantoperator= (Uint16 uiValue)
TZSimpleVariantoperator= (Uint32 uiValue)
TZSimpleVariantoperator= (unsigned int uiValue)
TZSimpleVariantoperator= (bool bValue)
TZSimpleVariantoperator= (const Float &rfValue)
TZSimpleVariantoperator= (const IString &rstrValue)
bool operator== (const TZSimpleVariant &rInpar) const
bool operator== (int iValue) const
bool operator== (Int iValue) const
bool operator== (Uint8 ucValue) const
bool operator== (Uint16 usValue) const
bool operator== (Uint32 ulValue) const
bool operator== (unsigned int uiValue) const
bool operator== (bool bValue) const
bool operator== (const Float &rfValue) const
bool operator== (const IString &rstrValue) const
bool operator!= (const TZSimpleVariant &rInpar) const
bool operator!= (int iValue) const
bool operator!= (Int iValue) const
bool operator!= (Uint8 ucValue) const
bool operator!= (Uint16 usValue) const
bool operator!= (Uint32 ulValue) const
bool operator!= (unsigned int uiValue) const
bool operator!= (bool bValue) const
bool operator!= (const Float &rfValue) const
bool operator!= (const IString &rstrValue) const

Detailed Description

The simple variant implements a light version of the ZVariant. It uses the same interface but should not be used as a heap data type with (addref/release). Use the assign methods instead to create a clean copy of data. A speciality of the simple variant is that signed integers are stored as Int only. Unsigned integers are stored in the correct bit size. This allows to handle (Uint8)255 as (Int8)-1 by using toInt8() method.


Member Enumeration Documentation

Possible data types

Enumerator:
etEmpty 
etFloat 
etInt 
etUint32 
etBool 
etString 
etUint8 
etUint16 

Constructor & Destructor Documentation

zeus::TZSimpleVariant::TZSimpleVariant (  ) [inline]

Creates an empty variant

zeus::TZSimpleVariant::TZSimpleVariant ( int  iValue ) [inline]

Creates a variant of an integer

zeus::TZSimpleVariant::TZSimpleVariant ( Int  iValue ) [inline]

Creates a variant of an integer

zeus::TZSimpleVariant::TZSimpleVariant ( unsigned int  uiValue ) [inline]

Creates a variant of an unsigned integer

zeus::TZSimpleVariant::TZSimpleVariant ( Uint8  ucValue ) [inline]

Creates a variant of an unsigned integer

zeus::TZSimpleVariant::TZSimpleVariant ( Uint16  usValue ) [inline]

Creates a variant of an unsigned integer

zeus::TZSimpleVariant::TZSimpleVariant ( Uint32  ulValue ) [inline]

Creates a variant of an unsigned integer

zeus::TZSimpleVariant::TZSimpleVariant ( const Float &  rfValue ) [inline]

Creates a variant of a float value

zeus::TZSimpleVariant::TZSimpleVariant ( const IString rstrValue ) [inline]

Creates a variant of a string value

zeus::TZSimpleVariant::TZSimpleVariant ( const TString rstrValue ) [inline]

Creates a variant of a string value

zeus::TZSimpleVariant::TZSimpleVariant ( const wchar_t *  pValue ) [inline]

Creates a variant of a string value

zeus::TZSimpleVariant::TZSimpleVariant ( bool  bValue ) [inline]

Creates a variant of a float value

zeus::TZSimpleVariant::TZSimpleVariant ( const TZSimpleVariant rInpar ) [inline]

copy constructor

virtual zeus::TZSimpleVariant::~TZSimpleVariant (  ) [inline, virtual]

destroys the variant


Member Function Documentation

void zeus::TZSimpleVariant::assign ( const TZSimpleVariant rInpar ) [inline]

assigns a variant

void zeus::TZSimpleVariant::assignBool ( bool  bValue ) [inline]

assigns an unsigned integer

void zeus::TZSimpleVariant::assignFloat ( const Float &  rfValue ) [inline]

assigns an unsigned integer

void zeus::TZSimpleVariant::assignInt ( Int  iValue ) [inline]

assigns an integer

void zeus::TZSimpleVariant::assignString ( const IString rstrValue ) [inline]

assigns an unsigned integer

void zeus::TZSimpleVariant::assignUint16 ( Uint16  usValue ) [inline]

assigns an unsigned integer

void zeus::TZSimpleVariant::assignUint32 ( Uint32  ulValue ) [inline]

assigns an unsigned integer

void zeus::TZSimpleVariant::assignUint8 ( Uint8  ucValue ) [inline]

assigns an unsigned integer

bool zeus::TZSimpleVariant::convert ( EDataType  eNewDataType ) [inline]

converts the content to a new type

bRetval

bool zeus::TZSimpleVariant::equals ( const TZSimpleVariant rInpar ) const [inline]

checks if two variants are equal

bool zeus::TZSimpleVariant::equalsBool ( bool  bValue ) const [inline]

checks if the variant equals the integer

bool zeus::TZSimpleVariant::equalsFloat ( const Float &  rfValue ) const [inline]

checks if the variant equals the integer

bool zeus::TZSimpleVariant::equalsInt ( Int  iValue ) const [inline]

checks if the variant equals the integer

bool zeus::TZSimpleVariant::equalsString ( const IString rstrValue ) const [inline]

checks if the variant equals the string

bool zeus::TZSimpleVariant::equalsUint ( Uint  uiValue ) const [inline]

checks if the variant equals the integer

const TZSimpleVariantData& zeus::TZSimpleVariant::getData (  ) const [inline]

returns the data

TZSimpleVariantData& zeus::TZSimpleVariant::getData (  ) [inline]

returns the data

EDataType zeus::TZSimpleVariant::getDataType (  ) const [inline]

returns the data type

bool zeus::TZSimpleVariant::operator!= ( unsigned int  uiValue ) const [inline]
bool zeus::TZSimpleVariant::operator!= ( Int  iValue ) const [inline]
bool zeus::TZSimpleVariant::operator!= ( const TZSimpleVariant rInpar ) const [inline]
bool zeus::TZSimpleVariant::operator!= ( int  iValue ) const [inline]
bool zeus::TZSimpleVariant::operator!= ( Uint8  ucValue ) const [inline]
bool zeus::TZSimpleVariant::operator!= ( Uint16  usValue ) const [inline]
bool zeus::TZSimpleVariant::operator!= ( Uint32  ulValue ) const [inline]
bool zeus::TZSimpleVariant::operator!= ( bool  bValue ) const [inline]
bool zeus::TZSimpleVariant::operator!= ( const Float &  rfValue ) const [inline]
bool zeus::TZSimpleVariant::operator!= ( const IString rstrValue ) const [inline]
TZSimpleVariant& zeus::TZSimpleVariant::operator= ( const TZSimpleVariant rInpar ) [inline]
TZSimpleVariant& zeus::TZSimpleVariant::operator= ( Uint8  uiValue ) [inline]
TZSimpleVariant& zeus::TZSimpleVariant::operator= ( Uint16  uiValue ) [inline]
TZSimpleVariant& zeus::TZSimpleVariant::operator= ( Uint32  uiValue ) [inline]
TZSimpleVariant& zeus::TZSimpleVariant::operator= ( bool  bValue ) [inline]
TZSimpleVariant& zeus::TZSimpleVariant::operator= ( const Float &  rfValue ) [inline]
TZSimpleVariant& zeus::TZSimpleVariant::operator= ( const IString rstrValue ) [inline]
TZSimpleVariant& zeus::TZSimpleVariant::operator= ( unsigned int  uiValue ) [inline]
TZSimpleVariant& zeus::TZSimpleVariant::operator= ( int  iValue ) [inline]
TZSimpleVariant& zeus::TZSimpleVariant::operator= ( Int  iValue ) [inline]
bool zeus::TZSimpleVariant::operator== ( Uint8  ucValue ) const [inline]
bool zeus::TZSimpleVariant::operator== ( const TZSimpleVariant rInpar ) const [inline]
bool zeus::TZSimpleVariant::operator== ( int  iValue ) const [inline]
bool zeus::TZSimpleVariant::operator== ( Int  iValue ) const [inline]
bool zeus::TZSimpleVariant::operator== ( Uint32  ulValue ) const [inline]
bool zeus::TZSimpleVariant::operator== ( unsigned int  uiValue ) const [inline]
bool zeus::TZSimpleVariant::operator== ( const Float &  rfValue ) const [inline]
bool zeus::TZSimpleVariant::operator== ( const IString rstrValue ) const [inline]
bool zeus::TZSimpleVariant::operator== ( Uint16  usValue ) const [inline]
bool zeus::TZSimpleVariant::operator== ( bool  bValue ) const [inline]
bool zeus::TZSimpleVariant::toBool ( bool *  pbError = NULL ) const [inline]

converts to a bool

Float zeus::TZSimpleVariant::toFloat ( bool *  pbError = NULL ) const [inline]

converts to a float

Float zeus::TZSimpleVariant::toFloatWithSign ( bool *  pbError = NULL ) const [inline]

converts to an float value. The highest bit of an unsigned value is used as sign

Int zeus::TZSimpleVariant::toInt ( bool *  pbError = NULL ) const [inline]

converts to an integer

Int16 zeus::TZSimpleVariant::toInt16 ( bool *  pbError = NULL ) const [inline]

converts to an 16bit integer

Int32 zeus::TZSimpleVariant::toInt32 ( bool *  pbError = NULL ) const [inline]

converts to an 32bit integer

Int8 zeus::TZSimpleVariant::toInt8 ( bool *  pbError = NULL ) const [inline]

converts to an 8bit integer

Int zeus::TZSimpleVariant::toIntWithSign ( bool *  pbError = NULL ) const [inline]

converts to an 32bit integer. The highest bit of an unsigned value is used as sign

TString zeus::TZSimpleVariant::toString (  ) const [inline]

converts to a string

Uint zeus::TZSimpleVariant::toUint ( bool *  pbError = NULL ) const [inline]

converts to an unsigned integer


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Sun Jan 22 2012 15:28:44