#include <rtdelphi.h>
Public Types | |
| enum | VariantType { typeString = 0, typeInt, typeDouble } |
| The possible types this variable may have. More... | |
Public Methods | |
| Variant () | |
| Creates a Variant which contains the integer 0. | |
| Variant (const Variant &) | |
| Copies the data over from the other variant. | |
| Variant & | operator= (const Variant &) |
| Copies the data over from the other variant. | |
| ~Variant () | |
| Variant (int) | |
| Creates a Variant which contains the given integer. | |
| Variant (double) | |
| Creates a Variant which contains the given double. | |
| Variant (const String &) | |
| Creates a Variant which contains the given String. | |
| void | set (int) |
| Sets this variant's value to the given integer. | |
| void | set (double) |
| Sets this variant's value to the given double. | |
| void | set (const String &) |
| Sets this variant's value to the given String. | |
| int | getInt (int def=0) const |
| Extracts an integer from this variant. More... | |
| double | getDouble (double def=0.) const |
| Extracts a double from this variant. More... | |
| String | getString () const |
| Converts this variant's data to a String representation and returns it. More... | |
| VariantType | getCurrentType () const |
| Returns the current type of this variant. | |
It is much like a typesafe union of these types.
|
|
The possible types this variable may have.
|
|
|
Extracts a double from this variant. Note that it is unimportant which type this variant actually contains, a double will be generated from it.
|
|
|
Extracts an integer from this variant. Note that it is unimportant which type this variant actually contains, an integer will be generated from it.
|
|
|
Converts this variant's data to a String representation and returns it. The operation does not change the variant itself. |