CrystalSpace

Public API Reference

csVariant Struct Reference
[Utilities]

Variant, ie a value whose type is set at runtime. More...

#include <csutil/variant.h>

List of all members.

Public Member Functions

 csVariant (const csVariant &var)
 Copy constructor.
 csVariant (iBase *ib)
 Constructor initialized with an iBase.
 csVariant (const csTransform &t)
 Constructor initialized with a value of type CSVAR_TRANSFORM.
 csVariant (const csMatrix3 &m)
 Constructor initialized with a value of type CSVAR_MATRIX3.
 csVariant (const csVector4 &v)
 Constructor initialized with a value of type CSVAR_VECTOR4.
 csVariant (const csVector3 &v)
 Constructor initialized with a value of type CSVAR_VECTOR3.
 csVariant (const csVector2 &v)
 Constructor initialized with a value of type CSVAR_VECTOR2.
 csVariant (const csColor4 &c)
 Constructor initialized with a value of type CSVAR_COLOR4.
 csVariant (const csColor &c)
 Constructor initialized with a value of type CSVAR_COLOR.
 csVariant (scfString &s)
 Constructor initialized with a value of type CSVAR_STRING (from an scfString).
 csVariant (const char *s)
 Constructor initialized with a value of type CSVAR_STRING (from a char*).
 csVariant (float f)
 Constructor initialized with a value of type CSVAR_FLOAT.
 csVariant (bool b)
 Constructor initialized with a value of type CSVAR_BOOL.
 csVariant (long l)
 Constructor initialized with a value of type CSVAR_LONG.
 csVariant (int i)
 Constructor initialized with a value of type CSVAR_LONG.
 csVariant ()
 Blank constructor; Set the variant to CSVAR_LONG and 0; Usually not used.
csString Description () const
 Return a textual description of this variant.
iBaseGetBase () const
 Retrieve an iBase.
bool GetBool () const
 Retrieve a bool.
csColor GetColor () const
 Retrieve a csColor.
csColor4 GetColor4 () const
 Retrieve a csColor4.
float GetFloat () const
 Retrieve a float.
long GetLong () const
 Retrieve a long.
csMatrix3 GetMatrix3 () const
 Retrieve a csMatrix3.
const char * GetString () const
 Retrieve a string.
csTransform GetTransform () const
 Retrieve a csTransform.
csVariantType GetType () const
 Get the type of the contained value. The default value is CSVAR_CMD.
csVector2 GetVector2 () const
 Retrieve a csVector2.
csVector3 GetVector3 () const
 Retrieve a csVector3.
csVector4 GetVector4 () const
 Retrieve a csVector4.
const csVariantoperator= (const csVariant &var)
 Assignment operator.
void SetBase (iBase *ib)
 Assign an iBase.
void SetBool (bool b)
 Assign a bool.
void SetColor (const csColor &c)
 Assign a csColor.
void SetColor4 (const csColor4 &c)
 Assign a csColor4.
void SetCommand ()
 Assign a command. A command has no value, it is just a flag which can be set or not.
void SetFloat (float f)
 Assign a float.
void SetLong (long l)
 Assign a long.
void SetMatrix3 (const csMatrix3 &m)
 Assign a csMatrix3.
void SetString (const char *s)
 Assign a string.
void SetTransform (const csTransform &t)
 Assign a csTransform.
void SetVector2 (const csVector2 &v)
 Assign a csVector2.
void SetVector3 (const csVector3 &v)
 Assign a csVector3.
void SetVector4 (const csVector4 &v)
 Assign a csVector4.

Detailed Description

Variant, ie a value whose type is set at runtime.

Warning:
Requesting another type than the contained one will trigger an assertion

Definition at line 82 of file variant.h.


Constructor & Destructor Documentation

csVariant::csVariant (  )  [inline]

Blank constructor; Set the variant to CSVAR_LONG and 0; Usually not used.

Where it is needed, the type and value should generally be overwritten anyway.

Definition at line 115 of file variant.h.

csVariant::csVariant ( int  i  )  [inline]

Constructor initialized with a value of type CSVAR_LONG.

Definition at line 117 of file variant.h.

csVariant::csVariant ( long  l  )  [inline]

Constructor initialized with a value of type CSVAR_LONG.

Definition at line 119 of file variant.h.

csVariant::csVariant ( bool  b  )  [inline]

Constructor initialized with a value of type CSVAR_BOOL.

Definition at line 121 of file variant.h.

csVariant::csVariant ( float  f  )  [inline]

Constructor initialized with a value of type CSVAR_FLOAT.

Definition at line 123 of file variant.h.

csVariant::csVariant ( const char *  s  )  [inline]

Constructor initialized with a value of type CSVAR_STRING (from a char*).

Definition at line 125 of file variant.h.

csVariant::csVariant ( scfString s  )  [inline]

Constructor initialized with a value of type CSVAR_STRING (from an scfString).

Definition at line 127 of file variant.h.

csVariant::csVariant ( const csColor c  )  [inline]

Constructor initialized with a value of type CSVAR_COLOR.

Definition at line 129 of file variant.h.

csVariant::csVariant ( const csColor4 c  )  [inline]

Constructor initialized with a value of type CSVAR_COLOR4.

Definition at line 131 of file variant.h.

csVariant::csVariant ( const csVector2 v  )  [inline]

Constructor initialized with a value of type CSVAR_VECTOR2.

Definition at line 133 of file variant.h.

csVariant::csVariant ( const csVector3 v  )  [inline]

Constructor initialized with a value of type CSVAR_VECTOR3.

Definition at line 135 of file variant.h.

csVariant::csVariant ( const csVector4 v  )  [inline]

Constructor initialized with a value of type CSVAR_VECTOR4.

Definition at line 137 of file variant.h.

csVariant::csVariant ( const csMatrix3 m  )  [inline]

Constructor initialized with a value of type CSVAR_MATRIX3.

Definition at line 139 of file variant.h.

csVariant::csVariant ( const csTransform t  )  [inline]

Constructor initialized with a value of type CSVAR_TRANSFORM.

Definition at line 141 of file variant.h.

csVariant::csVariant ( iBase ib  )  [inline]

Constructor initialized with an iBase.

Definition at line 143 of file variant.h.

csVariant::csVariant ( const csVariant var  )  [inline]

Copy constructor.

Definition at line 146 of file variant.h.


Member Function Documentation

csString csVariant::Description (  )  const [inline]

Return a textual description of this variant.

Definition at line 359 of file variant.h.

iBase* csVariant::GetBase (  )  const [inline]

Retrieve an iBase.

Definition at line 349 of file variant.h.

bool csVariant::GetBool (  )  const [inline]

Retrieve a bool.

Definition at line 289 of file variant.h.

csColor csVariant::GetColor (  )  const [inline]

Retrieve a csColor.

Definition at line 307 of file variant.h.

csColor4 csVariant::GetColor4 (  )  const [inline]

Retrieve a csColor4.

Definition at line 313 of file variant.h.

float csVariant::GetFloat (  )  const [inline]

Retrieve a float.

Definition at line 295 of file variant.h.

long csVariant::GetLong (  )  const [inline]

Retrieve a long.

Definition at line 283 of file variant.h.

csMatrix3 csVariant::GetMatrix3 (  )  const [inline]

Retrieve a csMatrix3.

Definition at line 337 of file variant.h.

const char* csVariant::GetString (  )  const [inline]

Retrieve a string.

Definition at line 301 of file variant.h.

csTransform csVariant::GetTransform (  )  const [inline]

Retrieve a csTransform.

Definition at line 343 of file variant.h.

csVariantType csVariant::GetType (  )  const [inline]

Get the type of the contained value. The default value is CSVAR_CMD.

Definition at line 356 of file variant.h.

csVector2 csVariant::GetVector2 (  )  const [inline]

Retrieve a csVector2.

Definition at line 319 of file variant.h.

csVector3 csVariant::GetVector3 (  )  const [inline]

Retrieve a csVector3.

Definition at line 325 of file variant.h.

csVector4 csVariant::GetVector4 (  )  const [inline]

Retrieve a csVector4.

Definition at line 331 of file variant.h.

const csVariant& csVariant::operator= ( const csVariant var  )  [inline]

Assignment operator.

Definition at line 162 of file variant.h.

void csVariant::SetBase ( iBase ib  )  [inline]

Assign an iBase.

Definition at line 274 of file variant.h.

void csVariant::SetBool ( bool  b  )  [inline]

Assign a bool.

Definition at line 184 of file variant.h.

void csVariant::SetColor ( const csColor c  )  [inline]

Assign a csColor.

Definition at line 214 of file variant.h.

void csVariant::SetColor4 ( const csColor4 c  )  [inline]

Assign a csColor4.

Definition at line 223 of file variant.h.

void csVariant::SetCommand (  )  [inline]

Assign a command. A command has no value, it is just a flag which can be set or not.

Definition at line 191 of file variant.h.

void csVariant::SetFloat ( float  f  )  [inline]

Assign a float.

Definition at line 197 of file variant.h.

void csVariant::SetLong ( long  l  )  [inline]

Assign a long.

Definition at line 177 of file variant.h.

void csVariant::SetMatrix3 ( const csMatrix3 m  )  [inline]

Assign a csMatrix3.

Definition at line 260 of file variant.h.

void csVariant::SetString ( const char *  s  )  [inline]

Assign a string.

Definition at line 204 of file variant.h.

void csVariant::SetTransform ( const csTransform t  )  [inline]

Assign a csTransform.

Definition at line 267 of file variant.h.

void csVariant::SetVector2 ( const csVector2 v  )  [inline]

Assign a csVector2.

Definition at line 233 of file variant.h.

void csVariant::SetVector3 ( const csVector3 v  )  [inline]

Assign a csVector3.

Definition at line 241 of file variant.h.

void csVariant::SetVector4 ( const csVector4 v  )  [inline]

Assign a csVector4.

Definition at line 250 of file variant.h.


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

Generated for Crystal Space 2.1 by doxygen 1.6.1