#include <Attributable.h>
|
enum | PrimitiveType {
PT_UNDEFINED,
PT_STRING,
PT_FLOAT,
PT_BOOL,
PT_INT,
PT_STRING_ARRAY,
PT_FLOAT_ARRAY,
PT_BOOL_ARRAY,
PT_INT_ARRAY,
PT_BLIND_DATA,
PT_BLIND_DATA_ARRAY,
PT_COUNT
} |
|
|
virtual bool | getBool (const wchar_t *key, Status *stat=0) const =0 |
|
virtual const bool * | getBoolArray (const wchar_t *key, size_t *count, Status *stat=0) const =0 |
|
virtual double | getFloat (const wchar_t *key, Status *stat=0) const =0 |
|
virtual const double * | getFloatArray (const wchar_t *key, size_t *count, Status *stat=0) const =0 |
|
virtual int32_t | getInt (const wchar_t *key, Status *stat=0) const =0 |
|
virtual const int32_t * | getIntArray (const wchar_t *key, size_t *count, Status *stat=0) const =0 |
|
virtual const wchar_t *const * | getKeys (size_t *count, Status *stat=0) const =0 |
|
virtual const wchar_t * | getString (const wchar_t *key, Status *stat=0) const =0 |
|
virtual const wchar_t *const * | getStringArray (const wchar_t *key, size_t *count, Status *stat=0) const =0 |
|
virtual PrimitiveType | getType (const wchar_t *key, Status *stat=0) const =0 |
|
virtual bool | hasKey (const wchar_t *key, Status *stat=0) const =0 |
|
Interface to provide read-only access to attributes of the basic types. All member functions are thread-safe.
- undefined keys result in result prt::PRT_KEY_NOT_FOUND
- each key is unique over all types
◆ PrimitiveType
The PrimitiveType enum enumerates the types which can be used in an Attributable.
Enumerator |
---|
PT_UNDEFINED | Undefined type.
|
PT_STRING | String type.
|
PT_FLOAT | Float type.
|
PT_BOOL | Boolean type.
|
PT_INT | Integer type.
|
PT_STRING_ARRAY | String array type.
|
PT_FLOAT_ARRAY | Float array type.
|
PT_BOOL_ARRAY | Boolean array type.
|
PT_INT_ARRAY | Integer array type.
|
PT_BLIND_DATA | Blind data type.
|
PT_BLIND_DATA_ARRAY | Blind data array type.
|
PT_COUNT | Number of primitive types.
|
◆ getBool()
virtual bool prt::Attributable::getBool |
( |
const wchar_t * |
key, |
|
|
Status * |
stat = 0 |
|
) |
| const |
|
pure virtual |
Gets a boolean value.
- Parameters
-
| key | Key to look for. |
[out] | stat | Optional pointer to return the status. Will be set to STATUS_KEY_NOT_FOUND if the key is not found or if the value is not a boolean. |
- Returns
- The value associated with a key or false if key not found or if the value is not a boolean.
◆ getBoolArray()
virtual const bool* prt::Attributable::getBoolArray |
( |
const wchar_t * |
key, |
|
|
size_t * |
count, |
|
|
Status * |
stat = 0 |
|
) |
| const |
|
pure virtual |
Gets an array of booleans. The returned pointer stays valid until destruction of the Attributable.
- Parameters
-
| key | Key to look for. |
[out] | count | Pointer to return the number of booleans in the array. |
[out] | stat | Optional pointer to return the status. Will be set to STATUS_KEY_NOT_FOUND if the key is not found or if the value is not an array of booleans. |
- Returns
- Pointer to the array associated with the key or 0 if key not found, the array is empty or if the value is not an array of booleans.
◆ getFloat()
virtual double prt::Attributable::getFloat |
( |
const wchar_t * |
key, |
|
|
Status * |
stat = 0 |
|
) |
| const |
|
pure virtual |
Gets a float value.
- Parameters
-
| key | Key to look for. |
[out] | stat | Optional pointer to return the status. Will be set to STATUS_KEY_NOT_FOUND if the key is not found or if the value is not a float. |
- Returns
- The value associated with a key or 0 if key not found or if the value is not a float.
◆ getFloatArray()
virtual const double* prt::Attributable::getFloatArray |
( |
const wchar_t * |
key, |
|
|
size_t * |
count, |
|
|
Status * |
stat = 0 |
|
) |
| const |
|
pure virtual |
Gets an array of floats. The returned pointer stays valid until destruction of the Attributable.
- Parameters
-
| key | Key to look for. |
[out] | count | Pointer to return the number of floats in the array. |
[out] | stat | Optional pointer to return the status. Will be set to STATUS_KEY_NOT_FOUND if the key is not found or if the value is not an array of floats. |
- Returns
- Pointer to the array associated with the key or 0 if key not found, the array is empty or if the value is not an array of floats.
◆ getInt()
virtual int32_t prt::Attributable::getInt |
( |
const wchar_t * |
key, |
|
|
Status * |
stat = 0 |
|
) |
| const |
|
pure virtual |
Gets an integer value.
- Parameters
-
| key | Key to look for. |
[out] | stat | Optional pointer to return the status. Will be set to STATUS_KEY_NOT_FOUND if the key is not found or if the value is not an int. |
- Returns
- The value associated with a key or 0 if key not found or if the value is not a int.
◆ getIntArray()
virtual const int32_t* prt::Attributable::getIntArray |
( |
const wchar_t * |
key, |
|
|
size_t * |
count, |
|
|
Status * |
stat = 0 |
|
) |
| const |
|
pure virtual |
Gets an array of integers. The returned pointer stays valid until destruction of the Attributable.
- Parameters
-
| key | Key to look for. |
[out] | count | Pointer to return the number of integers in the array. |
[out] | stat | Optional pointer to return the status. Will be set to STATUS_KEY_NOT_FOUND if the key is not found or if the value is not an array of integers. |
- Returns
- Pointer to the array associated with the key or 0 if key not found, the array is empty or if the value is not an array of integers.
◆ getKeys()
virtual const wchar_t* const* prt::Attributable::getKeys |
( |
size_t * |
count, |
|
|
Status * |
stat = 0 |
|
) |
| const |
|
pure virtual |
Get all used keys. The returned pointer stays valid until destruction of the Attributable.
- Parameters
-
[out] | count | Pointer to return the number of keys. |
[out] | stat | Optional pointer to return the status. |
- Returns
- Pointer to the array with all keys on success, 0 on error.
◆ getString()
virtual const wchar_t* prt::Attributable::getString |
( |
const wchar_t * |
key, |
|
|
Status * |
stat = 0 |
|
) |
| const |
|
pure virtual |
Gets a string. The returned pointer stays valid until destruction of the Attributable.
- Parameters
-
| key | Key to look for. |
[out] | stat | Optional pointer to return the status. Will be set to STATUS_KEY_NOT_FOUND if the key is not found or if the value is not a string. |
- Returns
- The pointer to a string associated with a key or 0 if key not found or if the value is not a string.
◆ getStringArray()
virtual const wchar_t* const* prt::Attributable::getStringArray |
( |
const wchar_t * |
key, |
|
|
size_t * |
count, |
|
|
Status * |
stat = 0 |
|
) |
| const |
|
pure virtual |
Gets an array of strings. The returned pointer stays valid until destruction of the Attributable.
- Parameters
-
| key | Key to look for. |
[out] | count | Pointer to return the number of strings in the array. |
[out] | stat | Optional pointer to return the status. Will be set to STATUS_KEY_NOT_FOUND if the key is not found or if the value is not an array of strings. |
- Returns
- Pointer to the array associated with the key or 0 if key not found, the array is empty or if the value is not an array of strings.
◆ getType()
virtual PrimitiveType prt::Attributable::getType |
( |
const wchar_t * |
key, |
|
|
Status * |
stat = 0 |
|
) |
| const |
|
pure virtual |
Gets the type of the value associated to a key.
- Parameters
-
| key | Key to look for. |
[out] | stat | Optional pointer to return the status. |
- Returns
- The type of the key's value or PT_UNDEFINED if the key is not found.
◆ hasKey()
virtual bool prt::Attributable::hasKey |
( |
const wchar_t * |
key, |
|
|
Status * |
stat = 0 |
|
) |
| const |
|
pure virtual |
Checks whether a key is set.
- Parameters
-
| key | Key to look for. |
[out] | stat | Optional pointer to return the status. |
- Returns
- true if the key is set, false otherwise.
The documentation for this class was generated from the following file: