Pyro higlevel API
|
Utility class for storage of user settings and preferences. More...
Classes | |
class | Private |
Public Member Functions | |
Settings () | |
Default constructor. More... | |
Settings (SeekableIO *pcFile) | |
Constructor. More... | |
~Settings () | |
status_t | Load (void) |
Load settings. More... | |
status_t | Save (void) const |
Save settings. More... | |
Settings & | operator= (const Settings &cSource) |
Copy a Settings object. More... | |
Settings & | operator= (const Message &cSource) |
Set Message data. More... | |
Path | GetPath () const |
Get directory path. More... | |
File | GetFile () const |
Get filename. More... | |
void | SetPath (Path *pcPath) |
Set directory path. More... | |
void | SetFile (SeekableIO *pcFile) |
Set file. More... | |
void | SetFile (String cFilename) |
Set filename. More... | |
String | GetString (const char *pzName, const char *pzDefault="", int nIndex=0) const |
Get a string. More... | |
int8 | GetInt8 (const char *pzName, int8 nDefault, int nIndex=0) const |
Get an integer. More... | |
int16 | GetInt16 (const char *pzName, int16 nDefault, int nIndex=0) const |
Get an integer. More... | |
int32 | GetInt32 (const char *pzName, int32 nDefault, int nIndex=0) const |
Get an integer. More... | |
int64 | GetInt64 (const char *pzName, int64 nDefault, int nIndex=0) const |
Get an integer. More... | |
bool | GetBool (const char *pzName, bool bDefault, int nIndex=0) const |
Get a boolean. More... | |
float | GetFloat (const char *pzName, float vDefault, int nIndex=0) const |
Get a float. More... | |
double | GetDouble (const char *pzName, double vDefault, int nIndex=0) const |
Get a double. More... | |
Rect | GetRect (const char *pzName, const Rect &cDefault, int nIndex=0) const |
Get a Rect. More... | |
IRect | GetIRect (const char *pzName, const IRect &cDefault, int nIndex=0) const |
Get an IRect. More... | |
Point | GetPoint (const char *pzName, const Point &cDefault, int nIndex=0) const |
Get a Point. More... | |
IPoint | GetIPoint (const char *pzName, const IPoint &cDefault, int nIndex=0) const |
Get an IPoint. More... | |
Color32_s | GetColor32 (const char *pzName, const Color32_s &cDefault, int nIndex=0) const |
Get a Color32_s. More... | |
Variant | GetVariant (const char *pzName, const Variant &cDefault, int nIndex=0) const |
Get a Variant. More... | |
status_t | SetData (const char *pzName, int nType, const void *pData, uint32 nSize, int nIndex=0, bool bFixedSize=true, int nMaxCountHint=1) |
Change a data member. More... | |
status_t | SetString (const char *pzName, const String &cValue, int nIndex=0) |
Add or change a string member. More... | |
status_t | SetInt8 (const char *pzName, int8 cValue, int nIndex=0) |
Add or change an int8 member. More... | |
status_t | SetInt16 (const char *pzName, int16 cValue, int nIndex=0) |
Add or change an int16 member. More... | |
status_t | SetInt32 (const char *pzName, int32 cValue, int nIndex=0) |
Add or change an int32 member. More... | |
status_t | SetInt64 (const char *pzName, int64 cValue, int nIndex=0) |
Add or change an int64 member. More... | |
status_t | SetBool (const char *pzName, bool cValue, int nIndex=0) |
Add or change a bool member. More... | |
status_t | SetFloat (const char *pzName, float cValue, int nIndex=0) |
Add or change a float member. More... | |
status_t | SetDouble (const char *pzName, double cValue, int nIndex=0) |
Add or change a double member. More... | |
status_t | SetRect (const char *pzName, const Rect &cValue, int nIndex=0) |
Add or change an Rect member. More... | |
status_t | SetIRect (const char *pzName, const IRect &cValue, int nIndex=0) |
Add or change an IRect object member. More... | |
status_t | SetPoint (const char *pzName, const Point &cValue, int nIndex=0) |
Add or change a Point object member. More... | |
status_t | SetIPoint (const char *pzName, const IPoint &cValue, int nIndex=0) |
Add or change an IPoint object member. More... | |
status_t | SetColor32 (const char *pzName, const Color32_s &cValue, int nIndex=0) |
Add or change a Color32_s object member. More... | |
status_t | SetMessage (const char *pzName, const Message &cValue, int nIndex=0) |
Add or change a message object member. More... | |
status_t | SetVariant (const char *pzName, const Variant &cValue, int nIndex=0) |
Add or change a Variant member. More... | |
Public Member Functions inherited from os::Message | |
Message (int nCode=0) | |
Constructor. More... | |
Message (const Message &cMsg) | |
Copy constructor. More... | |
Message (const void *pFlattenedData) | |
Construct a message from a "flattened" buffer. More... | |
~Message () | |
Destructor. More... | |
int | GetCode (void) const |
void | SetCode (int nCode) |
size_t | GetFlattenedSize (void) const |
Get the required buffer size needed to "flatten" this message. More... | |
status_t | Flatten (uint8 *pBuffer, size_t nSize) const |
Write the message to a flat data-blob. More... | |
status_t | Unflatten (const uint8 *pBuffer) |
Reconstruct a message from a data-blob created by Flatten(). More... | |
status_t | AddData (const char *pzName, int nType, const void *pData, uint32 nSize, bool bFixedSize=true, int nMaxCountHint=1) |
Add a data member to the message. More... | |
status_t | AddObject (const char *pzName, const Flattenable &cVal) |
Add an object as a member of this message. More... | |
status_t | AddMessage (const char *pzName, const Message *pcVal) |
Add another message object as a member of this message. More... | |
status_t | AddPointer (const char *pzName, const void *pVal) |
Add a pointer to the message. More... | |
status_t | AddInt8 (const char *pzName, int8 nVal) |
Add a 8-bit integer to the message. More... | |
status_t | AddInt16 (const char *pzName, int16 nVal) |
Add a 16-bit integer to the message. More... | |
status_t | AddInt32 (const char *pzName, int32 nVal) |
Add a 32-bit integer to the message. More... | |
status_t | AddInt64 (const char *pzName, int64 nVal) |
Add a 64-bit integer to the message. More... | |
status_t | AddBool (const char *pzName, bool bVal) |
Add a boolean value to the message. More... | |
status_t | AddFloat (const char *pzName, float vVal) |
Add a float to the message. More... | |
status_t | AddDouble (const char *pzName, double vVal) |
Add a double to the message. More... | |
status_t | AddRect (const char *pzName, const Rect &cVal) |
status_t | AddIRect (const char *pzName, const IRect &cVal) |
status_t | AddPoint (const char *pzName, const Point &cVal) |
status_t | AddIPoint (const char *pzName, const IPoint &cVal) |
status_t | AddColor32 (const char *pzName, const Color32_s &cVal) |
status_t | AddString (const char *pzName, const char *pzString) |
Add a string to the message. More... | |
status_t | AddString (const char *pzName, const std::string &cString) |
Add a string to the message. More... | |
status_t | AddString (const char *pzName, const String &cString) |
status_t | AddVariant (const char *pzName, const Variant &cVal) |
status_t | FindData (const char *pzName, int nType, const void **ppData, size_t *pnSize, int nIndex=0) const |
status_t | FindObject (const char *pzName, Flattenable &cVal, int nIndex=0) const |
status_t | FindMessage (const char *pzName, Message *ppcVal, int nIndex=0) const |
status_t | FindPointer (const char *pzName, void **ppVal, int nIndex=0) const |
status_t | FindInt8 (const char *pzName, int8 *pnVal, int nIndex=0) const |
status_t | FindInt16 (const char *pzName, int16 *pnVal, int nIndex=0) const |
status_t | FindInt32 (const char *pzName, int32 *pnVal, int nIndex=0) const |
status_t | FindInt64 (const char *pzName, int64 *pnVal, int nIndex=0) const |
status_t | FindBool (const char *pzName, bool *pbVal, int nIndex=0) const |
status_t | FindFloat (const char *pzName, float *pvVal, int nIndex=0) const |
status_t | FindDouble (const char *pzName, double *pvVal, int nIndex=0) const |
status_t | FindRect (const char *pzName, Rect *pcVal, int nIndex=0) const |
status_t | FindIRect (const char *pzName, IRect *pcVal, int nIndex=0) const |
status_t | FindPoint (const char *pzName, Point *pcVal, int nIndex=0) const |
status_t | FindIPoint (const char *pzName, IPoint *pcVal, int nIndex=0) const |
status_t | FindColor32 (const char *pzName, Color32_s *pcVal, int nIndex=0) const |
status_t | FindString (const char *pzName, const char **pzString, int nIndex=0) const |
status_t | FindString (const char *pzName, std::string *pcString, int nIndex=0) const |
status_t | FindString (const char *pzName, String *pcString, int nIndex=0) const |
status_t | FindVariant (const char *pzName, Variant *pcVal, int nIndex=0) const |
template<class T > | |
status_t | FindInt (const char *pzName, T *pnVal, int nIndex=0) const |
status_t | RemoveData (const char *pzName, int nIndex=0) |
Delete an element from the message. More... | |
status_t | RemoveName (const char *pzName) |
Remove all entries stored under a given name. More... | |
status_t | GetNameInfo (const char *pzName, int *pnType=NULL, int *pnCount=NULL) const |
int | CountNames (void) const |
String | GetName (int nIndex) const |
void | MakeEmpty (void) |
Clear the message. More... | |
bool | IsEmpty (void) const |
bool | WasDelivered (void) const |
bool | IsSourceWaiting (void) const |
bool | IsSourceRemote (void) const |
Messenger | ReturnAddress (void) const |
bool | IsReply (void) const |
status_t | SendReply (int nCode, Handler *pcReplyHandler=NULL) |
status_t | SendReply (Message *pcTheReply, Handler *pcReplyHandler=NULL, uint nTimeOut=~0) |
status_t | SendReply (int nCode, Message *pcReplyToReply) |
status_t | SendReply (Message *pcTheReply, Message *pcReplyToReply, int nSendTimOut=~0, int nReplyTimeOut=~0) |
Message & | operator= (const Message &cOther) |
Copy the content of another message. More... | |
Settings::Settings | ( | ) |
References os::Settings::Private::SetPath().
Settings::Settings | ( | SeekableIO * | pcFile | ) |
pcFile | SeekableIO object, e.g. os::File. |
References os::Settings::Private::SetIO().
Settings::~Settings | ( | ) |
bool Settings::GetBool | ( | const char * | pzName, |
bool | bDefault, | ||
int | nIndex = 0 |
||
) | const |
pzName | Name of the item to get. |
pzDefault | Default value to return, if the item is not present in the Settings object. |
nIndex | If several items with the same name exists you can use this parameter to specify which one you want. |
References os::Message::FindBool().
Color32_s Settings::GetColor32 | ( | const char * | pzName, |
const Color32_s & | cDefault, | ||
int | nIndex = 0 |
||
) | const |
pzName | Name of the item to get. |
pzDefault | Default value to return, if the item is not present in the Settings object. |
nIndex | If several items with the same name exists you can use this parameter to specify which one you want. |
References os::Message::FindColor32().
double Settings::GetDouble | ( | const char * | pzName, |
double | vDefault, | ||
int | nIndex = 0 |
||
) | const |
pzName | Name of the item to get. |
pzDefault | Default value to return, if the item is not present in the Settings object. |
nIndex | If several items with the same name exists you can use this parameter to specify which one you want. |
References os::Message::FindDouble().
File Settings::GetFile | ( | ) | const |
References os::Settings::Private::m_cFile.
float Settings::GetFloat | ( | const char * | pzName, |
float | vDefault, | ||
int | nIndex = 0 |
||
) | const |
pzName | Name of the item to get. |
pzDefault | Default value to return, if the item is not present in the Settings object. |
nIndex | If several items with the same name exists you can use this parameter to specify which one you want. |
References os::Message::FindFloat().
int16 Settings::GetInt16 | ( | const char * | pzName, |
int16 | nDefault, | ||
int | nIndex = 0 |
||
) | const |
pzName | Name of the item to get. |
pzDefault | Default value to return, if the item is not present in the Settings object. |
nIndex | If several items with the same name exists you can use this parameter to specify which one you want. |
References os::Message::FindInt16().
int32 Settings::GetInt32 | ( | const char * | pzName, |
int32 | nDefault, | ||
int | nIndex = 0 |
||
) | const |
pzName | Name of the item to get. |
pzDefault | Default value to return, if the item is not present in the Settings object. |
nIndex | If several items with the same name exists you can use this parameter to specify which one you want. |
References os::Message::FindInt32().
int64 Settings::GetInt64 | ( | const char * | pzName, |
int64 | nDefault, | ||
int | nIndex = 0 |
||
) | const |
pzName | Name of the item to get. |
pzDefault | Default value to return, if the item is not present in the Settings object. |
nIndex | If several items with the same name exists you can use this parameter to specify which one you want. |
References os::Message::FindInt64().
int8 Settings::GetInt8 | ( | const char * | pzName, |
int8 | nDefault, | ||
int | nIndex = 0 |
||
) | const |
pzName | Name of the item to get. |
pzDefault | Default value to return, if the item is not present in the Settings object. |
nIndex | If several items with the same name exists you can use this parameter to specify which one you want. |
References os::Message::FindInt8().
pzName | Name of the item to get. |
pzDefault | Default value to return, if the item is not present in the Settings object. |
nIndex | If several items with the same name exists you can use this parameter to specify which one you want. |
References os::Message::FindIPoint().
pzName | Name of the item to get. |
pzDefault | Default value to return, if the item is not present in the Settings object. |
nIndex | If several items with the same name exists you can use this parameter to specify which one you want. |
References os::Message::FindIRect().
Path Settings::GetPath | ( | ) | const |
References os::Settings::Private::m_cPath.
pzName | Name of the item to get. |
pzDefault | Default value to return, if the item is not present in the Settings object. |
nIndex | If several items with the same name exists you can use this parameter to specify which one you want. |
References os::Message::FindPoint().
pzName | Name of the item to get. |
pzDefault | Default value to return, if the item is not present in the Settings object. |
nIndex | If several items with the same name exists you can use this parameter to specify which one you want. |
References os::Message::FindRect().
String Settings::GetString | ( | const char * | pzName, |
const char * | pzDefault = "" , |
||
int | nIndex = 0 |
||
) | const |
pzName | Name of the item to get. |
pzDefault | Default value to return, if the item is not present in the Settings object. |
nIndex | If several items with the same name exists you can use this parameter to specify which one you want. |
References os::Message::FindString().
Variant Settings::GetVariant | ( | const char * | pzName, |
const Variant & | cDefault, | ||
int | nIndex = 0 |
||
) | const |
pzName | Name of the item to get. |
pzDefault | Default value to return, if the item is not present in the Settings object. |
nIndex | If several items with the same name exists you can use this parameter to specify which one you want. |
References os::Message::FindVariant().
status_t Settings::Load | ( | void | ) |
References os::Settings::Private::FreeStream(), os::Settings::Private::GetStream(), os::Settings::Private::m_pcIO, os::StreamableIO::Read(), os::SeekableIO::Seek(), SETTINGS_MAGIC, SETTINGS_VERSION, and os::Message::Unflatten().
Referenced by os::Locale::Private::Init().
cSource | Object to copy from. |
References os::Settings::Private::m_bUserStream, os::Settings::Private::m_cFile, os::Settings::Private::m_cPath, os::Settings::Private::m_pcIO, and os::Message::operator=().
cSource | Object to copy from. |
References os::Message::operator=().
status_t Settings::Save | ( | void | ) | const |
References os::Message::Flatten(), os::Settings::Private::FreeStream(), os::Message::GetFlattenedSize(), os::Settings::Private::GetStream(), os::Settings::Private::m_pcIO, SETTINGS_MAGIC, SETTINGS_VERSION, and os::StreamableIO::Write().
status_t Settings::SetBool | ( | const char * | pzName, |
bool | bValue, | ||
int | nIndex = 0 |
||
) |
pzName | A name uniquely identifying the object within the settings object. It is possible to add multiple objects of the same type under the same name but avoid adding different types of object under the same name. If you really need to do that, use Variants. |
bValue | The data to add. |
nIndex | Index to add the data to, if several objects have been added under the same name. An index outside the range of the array will add the object to the end. Leave this at 0 if you don't add multiple objects with the same name. |
References SetData(), and os::T_BOOL.
status_t Settings::SetColor32 | ( | const char * | pzName, |
const Color32_s & | cValue, | ||
int | nIndex = 0 |
||
) |
pzName | A name uniquely identifying the object within the settings object. It is possible to add multiple objects of the same type under the same name but avoid adding different types of object under the same name. If you really need to do that, use Variants. |
cValue | The data to add. |
nIndex | Index to add the data to, if several objects have been added under the same name. An index outside the range of the array will add the object to the end. Leave this at 0 if you don't add multiple objects with the same name. |
References SetData(), and os::T_COLOR32.
status_t Settings::SetData | ( | const char * | pzName, |
int | nType, | ||
const void * | pData, | ||
uint32 | nSize, | ||
int | nIndex = 0 , |
||
bool | bFixedSize = true , |
||
int | nMaxCountHint = 1 |
||
) |
pzName | The name used to identify the member. If there already exist a member with this name in the message the new member will be appended to an array of elements under this name. It is an error to append objects with different types under the same name. |
nType | Data type. This should be one of the predefined type codes. Normally you should only use this member to add T_RAW type data. All the more specific data-types should be added with one of the specialized Add*() members. |
pData | Pointer to the data to be add. The data will be copied into the message. |
nSize | Size of the pData buffer. |
nIndex | Array index. Always use 0 unless you've added multiple objects under the same name. A value outside of the range of the array will cause the object to be appended to the end of the array. |
bFixedSize | If you plan to make an array of members under the same name you must let the message know if each element can have a different size. If the message know that all the elements have the same size it can optimize the data a bit by only storing the size once. It will also greatly speed up array-element lookups if each element have the same size. If all elements in an array will have the same size or if you plan to add only one member under this name bFixedSize should be true. Otherwhice it should be false. |
nMaxCountHint | An estimate of how many members are going to be added to this array. If you plan to add many elements under the same name and you know up-front how many you are going to add it is a good idea to let the message know when adding the first element. The nMaxCountHint will be used to decide how much memory to be allocated for the array and if the estimate is correct it will avoid any expensive reallocations during element insertions. |
References os::Message::AddData().
Referenced by SetBool(), SetColor32(), SetDouble(), SetFloat(), SetInt16(), SetInt32(), SetInt64(), SetInt8(), SetIPoint(), SetIRect(), SetPoint(), SetRect(), and SetString().
status_t Settings::SetDouble | ( | const char * | pzName, |
double | vValue, | ||
int | nIndex = 0 |
||
) |
pzName | A name uniquely identifying the object within the settings object. It is possible to add multiple objects of the same type under the same name but avoid adding different types of object under the same name. If you really need to do that, use Variants. |
vValue | The data to add. |
nIndex | Index to add the data to, if several objects have been added under the same name. An index outside the range of the array will add the object to the end. Leave this at 0 if you don't add multiple objects with the same name. |
References SetData(), and os::T_DOUBLE.
void Settings::SetFile | ( | SeekableIO * | pcFile | ) |
pcFile | The new file. |
References os::Settings::Private::SetIO().
void Settings::SetFile | ( | String | cFilename | ) |
cFilename | The new filename. The filename will be appended to the current path. |
References os::Settings::Private::m_cPath, and os::Settings::Private::SetPath().
status_t Settings::SetFloat | ( | const char * | pzName, |
float | vValue, | ||
int | nIndex = 0 |
||
) |
pzName | A name uniquely identifying the object within the settings object. It is possible to add multiple objects of the same type under the same name but avoid adding different types of object under the same name. If you really need to do that, use Variants. |
vValue | The data to add. |
nIndex | Index to add the data to, if several objects have been added under the same name. An index outside the range of the array will add the object to the end. Leave this at 0 if you don't add multiple objects with the same name. |
References SetData(), and os::T_FLOAT.
status_t Settings::SetInt16 | ( | const char * | pzName, |
int16 | nValue, | ||
int | nIndex = 0 |
||
) |
pzName | A name uniquely identifying the object within the settings object. It is possible to add multiple objects of the same type under the same name but avoid adding different types of object under the same name. If you really need to do that, use Variants. |
nValue | The data to add. |
nIndex | Index to add the data to, if several objects have been added under the same name. An index outside the range of the array will add the object to the end. Leave this at 0 if you don't add multiple objects with the same name. |
References SetData(), and os::T_INT16.
status_t Settings::SetInt32 | ( | const char * | pzName, |
int32 | nValue, | ||
int | nIndex = 0 |
||
) |
pzName | A name uniquely identifying the object within the settings object. It is possible to add multiple objects of the same type under the same name but avoid adding different types of object under the same name. If you really need to do that, use Variants. |
nValue | The data to add. |
nIndex | Index to add the data to, if several objects have been added under the same name. An index outside the range of the array will add the object to the end. Leave this at 0 if you don't add multiple objects with the same name. |
References SetData(), and os::T_INT32.
status_t Settings::SetInt64 | ( | const char * | pzName, |
int64 | nValue, | ||
int | nIndex = 0 |
||
) |
pzName | A name uniquely identifying the object within the settings object. It is possible to add multiple objects of the same type under the same name but avoid adding different types of object under the same name. If you really need to do that, use Variants. |
nValue | The data to add. |
nIndex | Index to add the data to, if several objects have been added under the same name. An index outside the range of the array will add the object to the end. Leave this at 0 if you don't add multiple objects with the same name. |
References SetData(), and os::T_INT64.
status_t Settings::SetInt8 | ( | const char * | pzName, |
int8 | nValue, | ||
int | nIndex = 0 |
||
) |
pzName | A name uniquely identifying the object within the settings object. It is possible to add multiple objects of the same type under the same name but avoid adding different types of object under the same name. If you really need to do that, use Variants. |
nValue | The data to add. |
nIndex | Index to add the data to, if several objects have been added under the same name. An index outside the range of the array will add the object to the end. Leave this at 0 if you don't add multiple objects with the same name. |
References SetData(), and os::T_INT8.
status_t Settings::SetIPoint | ( | const char * | pzName, |
const IPoint & | cValue, | ||
int | nIndex = 0 |
||
) |
pzName | A name uniquely identifying the object within the settings object. It is possible to add multiple objects of the same type under the same name but avoid adding different types of object under the same name. If you really need to do that, use Variants. |
cValue | The data to add. |
nIndex | Index to add the data to, if several objects have been added under the same name. An index outside the range of the array will add the object to the end. Leave this at 0 if you don't add multiple objects with the same name. |
References SetData(), and os::T_IPOINT.
status_t Settings::SetIRect | ( | const char * | pzName, |
const IRect & | cValue, | ||
int | nIndex = 0 |
||
) |
pzName | A name uniquely identifying the object within the settings object. It is possible to add multiple objects of the same type under the same name but avoid adding different types of object under the same name. If you really need to do that, use Variants. |
cValue | The data to add. |
nIndex | Index to add the data to, if several objects have been added under the same name. An index outside the range of the array will add the object to the end. Leave this at 0 if you don't add multiple objects with the same name. |
References SetData(), and os::T_IRECT.
status_t Settings::SetMessage | ( | const char * | pzName, |
const Message & | cValue, | ||
int | nIndex = 0 |
||
) |
pzName | A name uniquely identifying the object within the settings object. It is possible to add multiple objects of the same type under the same name but avoid adding different types of object under the same name. If you really need to do that, use Variants. |
cValue | The data to add. |
nIndex | Index to add the data to, if several objects have been added under the same name. An index outside the range of the array will add the object to the end. Leave this at 0 if you don't add multiple objects with the same name. |
References os::Message::AddMessage(), os::Message::Flatten(), os::Message::GetFlattenedSize(), and os::T_MESSAGE.
void Settings::SetPath | ( | Path * | pcPath | ) |
pcPath | The new path. |
References os::Path::GetPath(), os::Settings::Private::m_cFile, and os::Settings::Private::SetPath().
status_t Settings::SetPoint | ( | const char * | pzName, |
const Point & | cValue, | ||
int | nIndex = 0 |
||
) |
pzName | A name uniquely identifying the object within the settings object. It is possible to add multiple objects of the same type under the same name but avoid adding different types of object under the same name. If you really need to do that, use Variants. |
cValue | The data to add. |
nIndex | Index to add the data to, if several objects have been added under the same name. An index outside the range of the array will add the object to the end. Leave this at 0 if you don't add multiple objects with the same name. |
References SetData(), and os::T_POINT.
status_t Settings::SetRect | ( | const char * | pzName, |
const Rect & | cValue, | ||
int | nIndex = 0 |
||
) |
pzName | A name uniquely identifying the object within the settings object. It is possible to add multiple objects of the same type under the same name but avoid adding different types of object under the same name. If you really need to do that, use Variants. |
cValue | The data to add. |
nIndex | Index to add the data to, if several objects have been added under the same name. An index outside the range of the array will add the object to the end. Leave this at 0 if you don't add multiple objects with the same name. |
References SetData(), and os::T_RECT.
status_t Settings::SetString | ( | const char * | pzName, |
const String & | cValue, | ||
int | nIndex = 0 |
||
) |
pzName | A name uniquely identifying the object within the settings object. It is possible to add multiple objects of the same type under the same name but avoid adding different types of object under the same name. If you really need to do that, use Variants. |
cValue | The data to add. |
nIndex | Index to add the data to, if several objects have been added under the same name. An index outside the range of the array will add the object to the end. Leave this at 0 if you don't add multiple objects with the same name. |
References os::String::c_str(), SetData(), os::String::size(), and os::T_STRING.
status_t Settings::SetVariant | ( | const char * | pzName, |
const Variant & | cValue, | ||
int | nIndex = 0 |
||
) |
pzName | A name uniquely identifying the object within the settings object. It is possible to add multiple objects of the same type under the same name but avoid adding different types of object under the same name. If you really need to do that, use Variants. |
cValue | The data to add. |
nIndex | Index to add the data to, if several objects have been added under the same name. An index outside the range of the array will add the object to the end. Leave this at 0 if you don't add multiple objects with the same name. |
References os::Message::AddVariant(), os::Variant::Flatten(), os::Variant::GetFlattenedSize(), and os::T_VARIANT.