Inheritance diagram for os::Settings:
Public Member Functions | |
Settings () | |
Default constructor. | |
Settings (SeekableIO *pcFile) | |
Constructor. | |
~Settings () | |
status_t | Load (void) |
Load settings. | |
status_t | Save (void) const |
Save settings. | |
Settings & | operator= (const Settings &cSource) |
Copy a Settings object. | |
Settings & | operator= (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 |
Settings::Settings | ( | ) |
Settings::Settings | ( | SeekableIO * | pcFile | ) |
pcFile | SeekableIO object, e.g. os::File. |
Settings::~Settings | ( | ) |
status_t Settings::Load | ( | void | ) |
status_t Settings::Save | ( | void | ) | const |
cSource | Object to copy from. |
cSource | Object to copy from. |
Reimplemented from os::Message.
Path Settings::GetPath | ( | ) | const |
File Settings::GetFile | ( | ) | const |
void Settings::SetPath | ( | Path * | pcPath | ) |
void Settings::SetFile | ( | SeekableIO * | pcFile | ) |
void Settings::SetFile | ( | String | cFilename | ) |
String Settings::GetString | ( | const char * | pzName, | |
const char * | pzDefault = "" , |
|||
int | nIndex = 0 | |||
) | const |
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. |
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. |
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. |
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. |
bool Settings::GetBool | ( | const char * | pzName, | |
bool | bDefault, | |||
int | nIndex = 0 | |||
) | const |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |