csVariant Struct Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
csVariant Struct Reference
Utilities

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

`#include <iutil/pluginconfig.h>`

List of all members.

## Public Member Functions
| csVariant ()
| Constructor initialized with a value of type CSVAR_CMD.
| csVariant (int i)
| Constructor initialized with a value of type CSVAR_LONG.
| csVariant (long l)
| Constructor initialized with a value of type CSVAR_LONG.
| csVariant (bool b)
| Constructor initialized with a value of type CSVAR_BOOL.
| csVariant (float f)
| Constructor initialized with a value of type CSVAR_FLOAT.
| csVariant (const char *s)
| Constructor initialized with a value of type CSVAR_STRING.
| csVariant (const csVariant &var)
| Copy constructor.
bool | GetBool () const
| Retrieve a bool.
float | GetFloat () const
| Retrieve a float.
long | GetLong () const
| Retrieve a long.
const char * | GetString () const
| Retrieve a string.
csVariantType | GetType () const
| Get the type of the contained value. The default value is CSVAR_LONG.
const csVariant & | operator= (const csVariant &var)
| Assignment operator.
void | SetBool (bool b)
| Assign a bool.
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 | SetString (const char *s)
| Assign a string.

## 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 50 of file pluginconfig.h.

## Constructor & Destructor Documentation

csVariant::csVariant | ( |  | ) | `[inline]`

Constructor initialized with a value of type CSVAR_CMD.

Definition at line 67 of file pluginconfig.h.

csVariant::csVariant | ( | int | i | ) | `[inline]`

Constructor initialized with a value of type CSVAR_LONG.

Definition at line 69 of file pluginconfig.h.

csVariant::csVariant | ( | long | l | ) | `[inline]`

Constructor initialized with a value of type CSVAR_LONG.

Definition at line 71 of file pluginconfig.h.

csVariant::csVariant | ( | bool | b | ) | `[inline]`

Constructor initialized with a value of type CSVAR_BOOL.

Definition at line 73 of file pluginconfig.h.

csVariant::csVariant | ( | float | f | ) | `[inline]`

Constructor initialized with a value of type CSVAR_FLOAT.

Definition at line 75 of file pluginconfig.h.

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

Constructor initialized with a value of type CSVAR_STRING.

Definition at line 77 of file pluginconfig.h.

csVariant::csVariant | ( | const csVariant & | var | ) | `[inline]`

Copy constructor.

Definition at line 80 of file pluginconfig.h.

## Member Function Documentation

bool csVariant::GetBool | ( |  | ) | const`[inline]`

Retrieve a bool.

Definition at line 146 of file pluginconfig.h.

float csVariant::GetFloat | ( |  | ) | const`[inline]`

Retrieve a float.

Definition at line 152 of file pluginconfig.h.

long csVariant::GetLong | ( |  | ) | const`[inline]`

Retrieve a long.

Definition at line 140 of file pluginconfig.h.

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

Retrieve a string.

Definition at line 158 of file pluginconfig.h.

csVariantType csVariant::GetType | ( |  | ) | const`[inline]`

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

Definition at line 165 of file pluginconfig.h.

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

Assignment operator.

Definition at line 92 of file pluginconfig.h.

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

Assign a bool.

Definition at line 109 of file pluginconfig.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 133 of file pluginconfig.h.

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

Assign a float.

Definition at line 116 of file pluginconfig.h.

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

Assign a long.

Definition at line 102 of file pluginconfig.h.

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

Assign a string.

Definition at line 123 of file pluginconfig.h.

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

- iutil/pluginconfig.h