Windows C++ Library
|
A wrapper facade for the VARIANT type. More...
#include <Variant.hpp>
Public Member Functions | |
Variant () | |
Default constructor. | |
Variant (bool value) | |
Construction from a boolean value. | |
Variant (int32 value) | |
Construction from a 32-bit signed value. | |
Variant (uint32 value) | |
Construction from a 32-bit unsigned long value. | |
Variant (int64 value) | |
Construction from a 64-bit signed value. | |
Variant (uint64 value) | |
Construction from a 64-bit unsigned long value. | |
Variant (const wchar_t *value) | |
Construction by creating a BSTR of the string. | |
Variant (ComStr &value) | |
Construction by taking ownership of a BSTR value. | |
Variant (const VARIANT &value, VARTYPE type) | |
Construction by coercing another variant to a different type. | |
Variant (const Variant &rhs) | |
Copy constructor. | |
const Variant & | operator= (const Variant &rhs) |
Assignment operator. | |
~Variant () | |
Destructor. | |
VARTYPE | type () const |
Get the values' full type. | |
bool | isArray () const |
Is a variant array? | |
VARTYPE | valueType () const |
Get the value type. | |
tstring | format () const |
Convert the variant value to a string. | |
bool | tryFormat (tstring &result) const |
Try and convert the variant value to a string. | |
Static Public Member Functions | |
static const tchar * | formatType (VARTYPE type) |
Format the variant type as a string. | |
static tstring | formatFullType (const VARIANT &value) |
Format the final variant type and any flags as a string. |
A wrapper facade for the VARIANT type.
Default constructor.
WCL::Variant::Variant | ( | bool | value | ) | [explicit] |
Construction from a boolean value.
WCL::Variant::Variant | ( | int32 | value | ) | [explicit] |
Construction from a 32-bit signed value.
WCL::Variant::Variant | ( | uint32 | value | ) | [explicit] |
Construction from a 32-bit unsigned long value.
WCL::Variant::Variant | ( | int64 | value | ) | [explicit] |
Construction from a 64-bit signed value.
WCL::Variant::Variant | ( | uint64 | value | ) | [explicit] |
Construction from a 64-bit unsigned long value.
WCL::Variant::Variant | ( | const wchar_t * | value | ) | [explicit] |
Construction by creating a BSTR of the string.
WCL::Variant::Variant | ( | ComStr & | value | ) | [explicit] |
Construction by taking ownership of a BSTR value.
WCL::Variant::Variant | ( | const VARIANT & | value, |
VARTYPE | type | ||
) |
Construction by coercing another variant to a different type.
WCL::Variant::Variant | ( | const Variant & | rhs | ) |
Copy constructor.
Destructor.
VARTYPE WCL::Variant::type | ( | ) | const [inline] |
Get the values' full type.
This returns the actual type as stored in the vt member of the underlying variant type.
bool WCL::Variant::isArray | ( | ) | const [inline] |
Is a variant array?
VARTYPE WCL::Variant::valueType | ( | ) | const [inline] |
Get the value type.
This returns just the data type part of the undelying vt member, i.e. it strips of any flags such as VT_ARRAY.
tstring WCL::Variant::format | ( | ) | const |
Convert the variant value to a string.
bool WCL::Variant::tryFormat | ( | tstring & | result | ) | const |
Try and convert the variant value to a string.
const tchar * WCL::Variant::formatType | ( | VARTYPE | type | ) | [static] |
Format the variant type as a string.
tstring WCL::Variant::formatFullType | ( | const VARIANT & | value | ) | [static] |
Format the final variant type and any flags as a string.
If the variant is type VT_VARIANT|VT_BYREF, it gets the contained variants type.