Variant Class Reference

Variant class is to be used as a single type to be stored in standard containers for either long, short or string data types. More...

List of all members.

Public Types

enum  VariantValueType {
  TYPE_WSTRING = 0, TYPE_STRING = 1, TYPE_UINT16 = 2, TYPE_UINT32 = 3,
  TYPE_UINT64 = 4, TYPE_INT16 = 5, TYPE_INT32 = 6, TYPE_INT64 = 7,
  TYPE_NULL = 8, TYPE_BOOL = 9
}

Public Member Functions

bool GetBoolValue () const
 Returns the variant value interpreted as a boolean.
simba_int16 GetInt16Value () const
 Returns the value as a simba_int16.
simba_int32 GetInt32Value () const
 Returns the value as a simba_int32.
simba_int64 GetInt64Value () const
 Returns the value as a simba_int64.
simba_signed_native GetIntNativeValue () const
 Returns the value as a simba_signed_native.
simba_string GetStringValue () const
 Returns the value as a UTF8 simba_string.
simba_uint16 GetUInt16Value () const
 Returns the value as a simba_uint16.
simba_uint32 GetUInt32Value () const
 Returns the value as a simba_uint32.
simba_uint64 GetUInt64Value () const
 Returns the value as a simba_uint64.
simba_unsigned_native GetUIntNativeValue () const
 Returns the value as a simba_unsigned_native.
VariantValueType GetValueType () const
 Returns the value's data type.
const simba_wstringGetWStringValue () const
 Returns the value as a simba_wstring.
bool operator!= (const Variant &in_rhs) const
 Overloaded != operator.
bool operator< (const Variant &in_rhs) const
 Less than operator for Variant.
Variantoperator= (bool in_that)
 Assignment operator for bool.
Variantoperator= (simba_int64 in_that)
 Assignment operator for simba_int64.
Variantoperator= (simba_int32 in_that)
 Assignment operator for simba_int32.
Variantoperator= (simba_int16 in_that)
 Assignment operator for simba_int16.
Variantoperator= (simba_uint64 in_that)
 Assignment operator for simba_uint64.
Variantoperator= (simba_uint32 in_that)
 Assignment operator for simba_uint32.
Variantoperator= (simba_uint16 in_that)
 Assignment operator for simba_uint16.
Variantoperator= (const simba_char *in_that)
 Assignment operator for simba_char*.
Variantoperator= (const wchar_t *in_that)
 Assignment operator for wchar_t*.
Variantoperator= (const simba_string &in_that)
 Assignment operator for simba_string.
Variantoperator= (const simba_wstring &in_that)
 Assignment operator for simba_wstring.
Variantoperator= (const Variant &in_that)
 Assignment operator for Variant.
bool operator== (const Variant &in_rhs) const
 Overloaded == operator.
void Swap (Variant &in_that)
 Swap this object with the given variant.
 Variant (bool in_value)
 bool constructor.
 Variant (simba_int64 in_value)
 simba_int64 constructor.
 Variant (simba_int32 in_value)
 simba_int32 constructor.
 Variant (simba_int16 in_value)
 simba_int16 constructor.
 Variant (simba_uint64 in_value)
 simba_uint64 constructor.
 Variant (simba_uint32 in_value)
 simba_uint32 constructor.
 Variant (simba_uint16 in_value)
 simba_uint16 constructor.
 Variant (const simba_char *in_value)
 simba_char* constructor. Constructs an intermediate simba_string
 Variant (const wchar_t *in_value)
 wchar_t* constructor. Constructs an intermediate simba_wstring.
 Variant (const simba_string &in_value)
 simba_string constructor.
 Variant (const simba_wstring &in_value)
 simba_wstring constructor.
 Variant (const Variant &in_value)
 Variant constructor.
 Variant ()
 Default constructor.
 ~Variant ()
 Destructor.

Detailed Description

Variant class is to be used as a single type to be stored in standard containers for either long, short or string data types.

While each constructor is responsible for setting m_valueType to reflect the constructor argument's data type, each cast operator will check m_valueType against the cast argument type and returns null if conversion is not valid or possible.


Member Enumeration Documentation

Enumerator:
TYPE_WSTRING 
TYPE_STRING 
TYPE_UINT16 
TYPE_UINT32 
TYPE_UINT64 
TYPE_INT16 
TYPE_INT32 
TYPE_INT64 
TYPE_NULL 
TYPE_BOOL 

Constructor & Destructor Documentation

Variant (  ) 

Default constructor.

Variant ( const Variant in_value  ) 

Variant constructor.

Parameters:
in_value 
Variant ( const simba_wstring in_value  ) 

simba_wstring constructor.

Parameters:
in_value 
Variant ( const simba_string in_value  ) 

simba_string constructor.

Parameters:
in_value 
Variant ( const wchar_t *  in_value  ) 

wchar_t* constructor. Constructs an intermediate simba_wstring.

Parameters:
in_value (NOT OWNED)
Variant ( const simba_char in_value  ) 

simba_char* constructor. Constructs an intermediate simba_string

Parameters:
in_value (NOT OWNED)
Variant ( simba_uint16  in_value  ) 

simba_uint16 constructor.

Parameters:
in_value 
Variant ( simba_uint32  in_value  ) 

simba_uint32 constructor.

Parameters:
in_value 
Variant ( simba_uint64  in_value  ) 

simba_uint64 constructor.

Parameters:
in_value 
Variant ( simba_int16  in_value  ) 

simba_int16 constructor.

Parameters:
in_value 
Variant ( simba_int32  in_value  ) 

simba_int32 constructor.

Parameters:
in_value 
Variant ( simba_int64  in_value  ) 

simba_int64 constructor.

Parameters:
in_value 
Variant ( bool  in_value  ) 

bool constructor.

Parameters:
in_value 
~Variant (  ) 

Destructor.


Member Function Documentation

bool GetBoolValue (  )  const

Returns the variant value interpreted as a boolean.

If the type is any numeric type, then 0 is false and other values are true. if the type is a string type, the following case insensitive values are false:

  • empty string
  • f
  • false
  • n
  • no
  • 0 all other values are true. If the type is null, then return false always.
Returns:
The value interpreted as a boolean value.
simba_int16 GetInt16Value (  )  const

Returns the value as a simba_int16.

Returns:
The variant value as a simba_int16.
simba_int32 GetInt32Value (  )  const

Returns the value as a simba_int32.

Returns:
The variant value as a simba_int32.
simba_int64 GetInt64Value (  )  const

Returns the value as a simba_int64.

Returns:
The variant value as a simba_int64.
simba_signed_native GetIntNativeValue (  )  const

Returns the value as a simba_signed_native.

Returns:
The variant value as a simba_signed_native.
simba_string GetStringValue (  )  const

Returns the value as a UTF8 simba_string.

Returns:
The variant value as a UTF8 simba_string.
simba_uint16 GetUInt16Value (  )  const

Returns the value as a simba_uint16.

Returns:
The variant value as a simba_uint16.
simba_uint32 GetUInt32Value (  )  const

Returns the value as a simba_uint32.

Returns:
The variant value as a simba_uint32.
simba_uint64 GetUInt64Value (  )  const

Returns the value as a simba_uint64.

Returns:
The variant value as a simba_int64.
simba_unsigned_native GetUIntNativeValue (  )  const

Returns the value as a simba_unsigned_native.

Returns:
The variant value as a simba_unsigned_native.
VariantValueType GetValueType (  )  const

Returns the value's data type.

Returns:
The variant data type.
const simba_wstring& GetWStringValue (  )  const

Returns the value as a simba_wstring.

Returns:
The variant value as a simba_wstring.
bool operator!= ( const Variant in_rhs  )  const

Overloaded != operator.

Parameters:
in_rhs The variant to compare to this one.
Returns:
True if the variants are not equal; false otherwise.
bool operator< ( const Variant in_rhs  )  const

Less than operator for Variant.

Parameters:
in_rhs 
Variant& operator= ( bool  in_that  ) 

Assignment operator for bool.

Parameters:
in_that 
Variant& operator= ( simba_int64  in_that  ) 

Assignment operator for simba_int64.

Parameters:
in_that 
Variant& operator= ( simba_int32  in_that  ) 

Assignment operator for simba_int32.

Parameters:
in_that 
Variant& operator= ( simba_int16  in_that  ) 

Assignment operator for simba_int16.

Parameters:
in_that 
Variant& operator= ( simba_uint64  in_that  ) 

Assignment operator for simba_uint64.

Parameters:
in_that 
Variant& operator= ( simba_uint32  in_that  ) 

Assignment operator for simba_uint32.

Parameters:
in_that 
Variant& operator= ( simba_uint16  in_that  ) 

Assignment operator for simba_uint16.

Parameters:
in_that 
Variant& operator= ( const simba_char in_that  ) 

Assignment operator for simba_char*.

Parameters:
in_that (NOT OWNED)
Variant& operator= ( const wchar_t *  in_that  ) 

Assignment operator for wchar_t*.

Parameters:
in_that (NOT OWNED)
Variant& operator= ( const simba_string in_that  ) 

Assignment operator for simba_string.

Parameters:
in_that 
Variant& operator= ( const simba_wstring in_that  ) 

Assignment operator for simba_wstring.

Parameters:
in_that 
Variant& operator= ( const Variant in_that  ) 

Assignment operator for Variant.

Parameters:
in_that 
bool operator== ( const Variant in_rhs  )  const

Overloaded == operator.

Parameters:
in_rhs The variant to compare to this one.
Returns:
True if the variants are equal; false otherwise.
void Swap ( Variant in_that  ) 

Swap this object with the given variant.


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

Generated on Wed May 17 14:21:19 2017 for SimbaEngine 10.1.3.1011 by simba