os::Settings Class Reference
[Various utillity classes.]

Utility class for storage of user settings and preferences. More...

Inheritance diagram for os::Settings:

os::Message List of all members.

Public Member Functions

 Settings ()
 Default constructor.
 Settings (SeekableIO *pcFile)
 Constructor.
 ~Settings ()
status_t Load (void)
 Load settings.
status_t Save (void) const
 Save settings.
Settingsoperator= (const Settings &cSource)
 Copy a Settings object.
Settingsoperator= (const Message &cSource)
 Set Message data.
Path GetPath () const
 Get directory path.
File GetFile () const
 Get filename.
void SetPath (Path *pcPath)
 Set directory path.
void SetFile (SeekableIO *pcFile)
 Set file.
void SetFile (String cFilename)
 Set filename.
String GetString (const char *pzName, const char *pzDefault="", int nIndex=0) const
 Get a string.
int8 GetInt8 (const char *pzName, int8 nDefault, int nIndex=0) const
 Get an integer.
int16 GetInt16 (const char *pzName, int16 nDefault, int nIndex=0) const
 Get an integer.
int32 GetInt32 (const char *pzName, int32 nDefault, int nIndex=0) const
 Get an integer.
int64 GetInt64 (const char *pzName, int64 nDefault, int nIndex=0) const
 Get an integer.
bool GetBool (const char *pzName, bool bDefault, int nIndex=0) const
 Get a boolean.
float GetFloat (const char *pzName, float vDefault, int nIndex=0) const
 Get a float.
double GetDouble (const char *pzName, double vDefault, int nIndex=0) const
 Get a double.
Rect GetRect (const char *pzName, const Rect &cDefault, int nIndex=0) const
 Get a Rect.
IRect GetIRect (const char *pzName, const IRect &cDefault, int nIndex=0) const
 Get an IRect.
Point GetPoint (const char *pzName, const Point &cDefault, int nIndex=0) const
 Get a Point.
IPoint GetIPoint (const char *pzName, const IPoint &cDefault, int nIndex=0) const
 Get an IPoint.
Color32_s GetColor32 (const char *pzName, const Color32_s &cDefault, int nIndex=0) const
 Get a Color32_s.
Variant GetVariant (const char *pzName, const Variant &cDefault, int nIndex=0) const
 Get a Variant.
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.
status_t SetString (const char *pzName, const String &cValue, int nIndex=0)
 Add or change a string member.
status_t SetInt8 (const char *pzName, int8 cValue, int nIndex=0)
 Add or change an int8 member.
status_t SetInt16 (const char *pzName, int16 cValue, int nIndex=0)
 Add or change an int16 member.
status_t SetInt32 (const char *pzName, int32 cValue, int nIndex=0)
 Add or change an int32 member.
status_t SetInt64 (const char *pzName, int64 cValue, int nIndex=0)
 Add or change an int64 member.
status_t SetBool (const char *pzName, bool cValue, int nIndex=0)
 Add or change a bool member.
status_t SetFloat (const char *pzName, float cValue, int nIndex=0)
 Add or change a float member.
status_t SetDouble (const char *pzName, double cValue, int nIndex=0)
 Add or change a double member.
status_t SetRect (const char *pzName, const Rect &cValue, int nIndex=0)
 Add or change an Rect member.
status_t SetIRect (const char *pzName, const IRect &cValue, int nIndex=0)
 Add or change an IRect object member.
status_t SetPoint (const char *pzName, const Point &cValue, int nIndex=0)
 Add or change a Point object member.
status_t SetIPoint (const char *pzName, const IPoint &cValue, int nIndex=0)
 Add or change an IPoint object member.
status_t SetColor32 (const char *pzName, const Color32_s &cValue, int nIndex=0)
 Add or change a Color32_s object member.
status_t SetMessage (const char *pzName, const Message &cValue, int nIndex=0)
 Add or change a message object member.
status_t SetVariant (const char *pzName, const Variant &cValue, int nIndex=0)
 Add or change a Variant member.

Classes

struct  FileHeader
class  Private

Detailed Description

Description:
The Settings class handles persistent storage of collections of data associated with names. You can of course also use the class to store other kinds of data. Settings is based on the very versatile name/value association mechanisms of os::Message, but it also extends the API with easy-to-use versions of the methods in os::Message, which are more suitable for managing settings.
See also:
os::Message
Author:
Henrik Isaksson ([email protected])


Constructor & Destructor Documentation

Settings::Settings (  ) 

Description:
Creates a Settings object for the current application and the current user. The default path will be "~/Settings/[Application name]/Settings".
Note:
This method relies on the Application object, and the app signature passed to it. If you haven't created an Application object, you will have to specify the path manually.
See also:
Load(), Save(), os::Application
Author:
Henrik Isaksson ([email protected])

Settings::Settings ( SeekableIO pcFile  ) 

Description:
Creates a Settings object bound to a specific stream object.
Parameters:
pcFile SeekableIO object, e.g. os::File.
See also:
Load(), Save(), os::File, os::SeekableIO
Author:
Henrik Isaksson ([email protected])

Settings::~Settings (  ) 


Member Function Documentation

status_t Settings::Load ( void   ) 

Description:
Loads settings from a settings file.
See also:
Save()
Author:
Henrik Isaksson ([email protected])

status_t Settings::Save ( void   )  const

Description:
Writes settings to a settings file.
See also:
Load()
Author:
Henrik Isaksson ([email protected])

Settings & Settings::operator= ( const Settings cSource  ) 

Description:
Copies both Message data and Path/File/Stream information.
Parameters:
cSource Object to copy from.
Author:
Henrik Isaksson ([email protected])

Settings & Settings::operator= ( const Message cSource  ) 

Description:
Copies only Message data from cSource to this object.
Parameters:
cSource Object to copy from.
Author:
Henrik Isaksson ([email protected])

Reimplemented from os::Message.

Path Settings::GetPath (  )  const

Description:
Returns the directory path to the settings file, excluding the file itself.
See also:
GetFile(), SetFile(), SetPath()
Author:
Kristian Van Der Vliet ([email protected])

File Settings::GetFile (  )  const

Description:
Returns the name of the settings file, excluding path.
See also:
GetPath()
Author:
Kristian Van Der Vliet ([email protected])
See also:
SetFile(), GetPath(), SetPath()

void Settings::SetPath ( Path pcPath  ) 

Description:
Set directory path.
Parameters:
pcPath The new path.
Author:
Kristian Van Der Vliet ([email protected])
See also:
GetFile(), SetFile(), GetPath()

void Settings::SetFile ( SeekableIO pcFile  ) 

Description:
Change the file which should be used to save and load Settings.
Parameters:
pcFile The new file.
Author:
Kristian Van Der Vliet ([email protected])
See also:
GetFile(), GetPath(), SetPath()

void Settings::SetFile ( String  cFilename  ) 

Description:
Change the filename which should be used to save and load Settings.
Parameters:
cFilename The new filename. The filename will be appended to the current path.
Author:
Kristian Van Der Vliet ([email protected])
See also:
GetFile(), GetPath(), SetPath()

String Settings::GetString ( const char *  pzName,
const char *  pzDefault = "",
int  nIndex = 0 
) const

Description:
Retrieve a string value from a Settings object.
Parameters:
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.
Author:
Henrik Isaksson ([email protected])

int8 Settings::GetInt8 ( const char *  pzName,
int8  nDefault,
int  nIndex = 0 
) const

Description:
Retrieve an 8 bit integer value from a Settings object.
Parameters:
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.
Author:
Henrik Isaksson ([email protected])

int16 Settings::GetInt16 ( const char *  pzName,
int16  nDefault,
int  nIndex = 0 
) const

Description:
Retrieve a 16 bit integer value from a Settings object.
Parameters:
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.
Author:
Henrik Isaksson ([email protected])

int32 Settings::GetInt32 ( const char *  pzName,
int32  nDefault,
int  nIndex = 0 
) const

Description:
Retrieve a 32 bit integer value from a Settings object.
Parameters:
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.
Author:
Henrik Isaksson ([email protected])

int64 Settings::GetInt64 ( const char *  pzName,
int64  nDefault,
int  nIndex = 0 
) const

Description:
Retrieve a 64 bit integer value from a Settings object.
Parameters:
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.
Author:
Henrik Isaksson ([email protected])

bool Settings::GetBool ( const char *  pzName,
bool  bDefault,
int  nIndex = 0 
) const

Description:
Retrieve a boolean value from a Settings object.
Parameters:
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.
Author:
Henrik Isaksson ([email protected])

float Settings::GetFloat ( const char *  pzName,
float  vDefault,
int  nIndex = 0 
) const

Description:
Retrieve a floating point value from a Settings object.
Parameters:
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.
Author:
Henrik Isaksson ([email protected])

double Settings::GetDouble ( const char *  pzName,
double  vDefault,
int  nIndex = 0 
) const

Description:
Retrieve a double precision floating point value from a Settings object.
Parameters:
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.
Author:
Henrik Isaksson ([email protected])

Rect Settings::GetRect ( const char *  pzName,
const Rect cDefault,
int  nIndex = 0 
) const

Description:
Retrieve a Rect value from a Settings object.
Parameters:
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.
Author:
Henrik Isaksson ([email protected])

IRect Settings::GetIRect ( const char *  pzName,
const IRect cDefault,
int  nIndex = 0 
) const

Description:
Retrieve an IRect value from a Settings object.
Parameters:
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.
Author:
Henrik Isaksson ([email protected])

Point Settings::GetPoint ( const char *  pzName,
const Point cDefault,
int  nIndex = 0 
) const

Description:
Retrieve a Point value from a Settings object.
Parameters:
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.
Author:
Henrik Isaksson ([email protected])

IPoint Settings::GetIPoint ( const char *  pzName,
const IPoint cDefault,
int  nIndex = 0 
) const

Description:
Retrieve an IPoint value from a Settings object.
Parameters:
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.
Author:
Henrik Isaksson ([email protected])

Color32_s Settings::GetColor32 ( const char *  pzName,
const Color32_s cDefault,
int  nIndex = 0 
) const

Description:
Retrieve a 32 bit colour (Color32_s) value from a Settings object.
Parameters:
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.
Author:
Henrik Isaksson ([email protected])

Variant Settings::GetVariant ( const char *  pzName,
const Variant cDefault,
int  nIndex = 0 
) const

Description:
Retrieve a Variant value from a Settings object.
Parameters:
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.
Author:
Henrik Isaksson ([email protected])

status_t Settings::SetData ( const char *  pzName,
int  nType,
const void *  pData,
uint32  nSize,
int  nIndex = 0,
bool  bFixedSize = true,
int  nMaxCountHint = 1 
)

Description:
Add or change data in the os::Message data container, upon which the settings class is based. See os::Message::AddData() for more information on the internal storage mechanism.
SetData() is a "catch all" function that can be used to add or change an untyped blob of data to the message. Normally you will use one of the other Set*() members that change a specificly typed data member but I will describe the general principle of changing members here.
When you add a member to a message (or settings object) you must give it a unique name that will later be used to lookup that member. It is possible to add multiple elements with the same name but they must then be of the same type and subsequent elements will be appended to an array associated with this name. Individual elements from the array can later be destined with the name/index pair passed to the various Get*() members.
Note:
The data buffer is copied into the message and you retain ownership over it.
Parameters:
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.
Returns:
On success 0 is returned. On error -1 is returned and an error code is written to the global variable errno.
See also:
os::Message::FindData(), os::Message::SetData()
Author:
Henrik Isaksson ([email protected])

status_t Settings::SetString ( const char *  pzName,
const String cValue,
int  nIndex = 0 
)

Description:
Add or change a string object member.
See SetData() and os::Message::AddData() for more details on how to add and change member values.
Parameters:
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.
Returns:
On success 0 is returned. On failure -1 is returned and a error code is written to the global variable errno.
Error codes:
ENOMEM Not enough memory.

See also:
GetString(), SetData(), os::Message::FindString(), os::Message::AddString(), os::Message::AddData(), os::Message::FindData()
Author:
Henrik Isaksson ([email protected])

status_t Settings::SetInt8 ( const char *  pzName,
int8  nValue,
int  nIndex = 0 
)

Description:
Add or change a 8 bit integer value.
See SetData() and os::Message::AddData() for more details on how to add and change member values.
Parameters:
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.
Returns:
On success 0 is returned. On failure -1 is returned and a error code is written to the global variable errno.
Error codes:
ENOMEM Not enough memory.

See also:
GetInt8(), SetData(), os::Message::FindInt8(), os::Message::AddInt8(), os::Message::AddData(), os::Message::FindData()
Author:
Henrik Isaksson ([email protected])

status_t Settings::SetInt16 ( const char *  pzName,
int16  nValue,
int  nIndex = 0 
)

Description:
Add or change a 16 bit integer value.
See SetData() and os::Message::AddData() for more details on how to add and change member values.
Parameters:
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.
Returns:
On success 0 is returned. On failure -1 is returned and a error code is written to the global variable errno.
Error codes:
ENOMEM Not enough memory.

See also:
GetInt16(), SetData(), os::Message::FindInt16(), os::Message::AddInt16(), os::Message::AddData(), os::Message::FindData()
Author:
Henrik Isaksson ([email protected])

status_t Settings::SetInt32 ( const char *  pzName,
int32  nValue,
int  nIndex = 0 
)

Description:
Add or change a 32 bit integer value.
See SetData() and os::Message::AddData() for more details on how to add and change member values.
Parameters:
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.
Returns:
On success 0 is returned. On failure -1 is returned and a error code is written to the global variable errno.
Error codes:
ENOMEM Not enough memory.

See also:
GetInt32(), SetData(), os::Message::FindInt32(), os::Message::AddInt32(), os::Message::AddData(), os::Message::FindData()
Author:
Henrik Isaksson ([email protected])

status_t Settings::SetInt64 ( const char *  pzName,
int64  nValue,
int  nIndex = 0 
)

Description:
Add or change a 64 bit integer value.
See SetData() and os::Message::AddData() for more details on how to add and change member values.
Parameters:
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.
Returns:
On success 0 is returned. On failure -1 is returned and a error code is written to the global variable errno.
Error codes:
ENOMEM Not enough memory.

See also:
GetInt64(), SetData(), os::Message::FindInt64(), os::Message::AddInt64(), os::Message::AddData(), os::Message::FindData()
Author:
Henrik Isaksson ([email protected])

status_t Settings::SetBool ( const char *  pzName,
bool  bValue,
int  nIndex = 0 
)

Description:
Add or change a boolean value member.
See SetData() and os::Message::AddData() for more details on how to add and change member values.
Parameters:
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.
Returns:
On success 0 is returned. On failure -1 is returned and a error code is written to the global variable errno.
Error codes:
ENOMEM Not enough memory.

See also:
GetBool(), SetData(), os::Message::FindBool(), os::Message::AddBool(), os::Message::AddData(), os::Message::FindData()
Author:
Henrik Isaksson ([email protected])

status_t Settings::SetFloat ( const char *  pzName,
float  vValue,
int  nIndex = 0 
)

Description:
Add or change a float point value member.
See SetData() and os::Message::AddData() for more details on how to add and change member values.
Parameters:
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.
Returns:
On success 0 is returned. On failure -1 is returned and a error code is written to the global variable errno.
Error codes:
ENOMEM Not enough memory.

See also:
GetFloat(), SetData(), os::Message::FindFloat(), os::Message::AddFloat(), os::Message::AddData(), os::Message::FindData()
Author:
Henrik Isaksson ([email protected])

status_t Settings::SetDouble ( const char *  pzName,
double  vValue,
int  nIndex = 0 
)

Description:
Add or change a double precision floating point object member.
See SetData() and os::Message::AddData() for more details on how to add and change member values.
Parameters:
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.
Returns:
On success 0 is returned. On failure -1 is returned and a error code is written to the global variable errno.
Error codes:
ENOMEM Not enough memory.

See also:
GetFloat(), SetData(), os::Message::FindFloat(), os::Message::AddFloat(), os::Message::AddData(), os::Message::FindData()
Author:
Henrik Isaksson ([email protected])

status_t Settings::SetRect ( const char *  pzName,
const Rect cValue,
int  nIndex = 0 
)

Description:
Add or change an Rect object member.
See SetData() and os::Message::AddData() for more details on how to add and change member values.
Parameters:
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.
Returns:
On success 0 is returned. On failure -1 is returned and a error code is written to the global variable errno.
Error codes:
ENOMEM Not enough memory.

See also:
GetRect(), SetData(), os::Message::FindRect(), os::Message::AddRect(), os::Message::AddData(), os::Message::FindData()
Author:
Henrik Isaksson ([email protected])

status_t Settings::SetIRect ( const char *  pzName,
const IRect cValue,
int  nIndex = 0 
)

Description:
Add or change an IRect object member.
See SetData() and os::Message::AddData() for more details on how to add and change member values.
Parameters:
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.
Returns:
On success 0 is returned. On failure -1 is returned and a error code is written to the global variable errno.
Error codes:
ENOMEM Not enough memory.

See also:
GetIRect(), SetData(), os::Message::FindIRect(), os::Message::AddIRect(), os::Message::AddData(), os::Message::FindData()
Author:
Henrik Isaksson ([email protected])

status_t Settings::SetPoint ( const char *  pzName,
const Point cValue,
int  nIndex = 0 
)

Description:
Add or change a Point object member.
See SetData() and os::Message::AddData() for more details on how to add and change member values.
Parameters:
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.
Returns:
On success 0 is returned. On failure -1 is returned and a error code is written to the global variable errno.
Error codes:
ENOMEM Not enough memory.

See also:
GetPoint(), SetData(), os::Message::FindPoint(), os::Message::AddPoint(), os::Message::AddData(), os::Message::FindData()
Author:
Henrik Isaksson ([email protected])

status_t Settings::SetIPoint ( const char *  pzName,
const IPoint cValue,
int  nIndex = 0 
)

Description:
Add or change a IPoint object member.
See SetData() and os::Message::AddData() for more details on how to add and change member values.
Parameters:
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.
Returns:
On success 0 is returned. On failure -1 is returned and a error code is written to the global variable errno.
Error codes:
ENOMEM Not enough memory.

See also:
GetIPoint(), SetData(), os::Message::FindIPoint(), os::Message::AddIPoint(), os::Message::AddData(), os::Message::FindData()
Author:
Henrik Isaksson ([email protected])

status_t Settings::SetColor32 ( const char *  pzName,
const Color32_s cValue,
int  nIndex = 0 
)

Description:
Add or change a Color32_s object member.
See SetData() and os::Message::AddData() for more details on how to add and change member values.
Parameters:
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.
Returns:
On success 0 is returned. On failure -1 is returned and a error code is written to the global variable errno.
Error codes:
ENOMEM Not enough memory.

See also:
GetColor32(), SetData(), os::Message::FindColor32(), os::Message::AddColor32(), os::Message::AddData(), os::Message::FindData()
Author:
Henrik Isaksson ([email protected])

status_t Settings::SetMessage ( const char *  pzName,
const Message cValue,
int  nIndex = 0 
)

Description:
Add or change a message object member.
See SetData() and os::Message::AddData() for more details on how to add and change member values.
Parameters:
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.
Returns:
On success 0 is returned. On failure -1 is returned and a error code is written to the global variable errno.
Error codes:
ENOMEM Not enough memory to expand the message.

See also:
GetMessage(), SetData(), os::Message::FindMessage(), os::Message::AddMessage(), os::Message::AddData(), os::Message::FindData()
Author:
Henrik Isaksson ([email protected])

status_t Settings::SetVariant ( const char *  pzName,
const Variant cValue,
int  nIndex = 0 
)

Description:
Add or change a Variant object member.
See SetData() and os::Message::AddData() for more details on how to add and change member values.
Parameters:
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.
Returns:
On success 0 is returned. On failure -1 is returned and a error code is written to the global variable errno.
Error codes:
ENOMEM Not enough memory.

See also:
GetVariant(), SetData(), os::Message::FindVariant(), os::Message::AddVariant(), os::Message::AddData(), os::Message::FindData()
Author:
Henrik Isaksson ([email protected])


Generated on Sat May 9 22:51:19 2009 for Syllable higlevel API by  doxygen 1.5.1