The UaSettingsSection class provides persistent platform-independent application settings.
More...
#include <uasettingssection.h>
|
| UaSettingsSection (const UaUniString &sGroup) |
| Construction with value. More...
|
|
| ~UaSettingsSection () |
| destruction
|
|
bool | removeKey (const UaUniString &sKey) |
| This method removes a given key sKey from the map. More...
|
|
void | setValue (const UaUniString &sKey, const UaUniString &sValue) |
| Writes a new value sValue with the given key sKey into the map. More...
|
|
UaUniString | getValue (const UaUniString &sKey, const UaUniString &sDefaultValue) |
| This method iterates over all key-value pairs in the map and searches for the wanted value of the given key sKey. More...
|
|
bool | contains (const UaUniString &sKey) |
| Checks if the key sKey is existing in the section. More...
|
|
UaSettingsSection * | findSettingsSection (const UaUniString &sGroup) |
| This method will return the actual section of the map. More...
|
|
void | addSettingsSubSection (UaSettingsSection *pSubSection) |
| Adds a new subsection to the map. More...
|
|
void | setParentSection (UaSettingsSection *pParent) |
| Sets the parent section to remember it if there is a subsection. More...
|
|
UaSettingsSection * | getParentSection () |
| Getter method for the parent section. More...
|
|
void | getAllSubSections (UaUniStringList *sList, int *index, const UaUniString &sPrefix) |
| Get the subsections (if available) for all sections of the INI file. More...
|
|
void | getAllSubKeys (UaUniStringList *sList, int *index, const UaUniString &sPrefix) |
| Get the subkeys (if available) for all sections of the INI file. More...
|
|
void | getAllKeyValueStrings (UaUniStringList *sList, int *index, const UaUniString &sPrefix) |
| Get the subsections (if available) for all sections of the INI file. More...
|
|
void | getKeyValuePairs (UaUniStringList *sList, int *index, const UaUniString &sPrefix) |
| Get the "key" and "value" for the INI file. More...
|
|
UaUniString | getGroup () |
| Getter method for the actual group/section. More...
|
|
The UaSettingsSection class provides persistent platform-independent application settings.
UaSettingsSection is a classical helper class to create the information needed for the class UaSettings. This class looks after the correct handling of the (sub) sections, keys and values needed to create an INI file. All information which will be written to the file is kept in the memory during runtime and will be written into a file when the object will be destroyed.
UaSettingsSection::UaSettingsSection |
( |
const UaUniString & |
sGroup | ) |
|
Construction with value.
- Parameters
-
sGroup | the name of a section to write into the map. |
Adds a new subsection to the map.
This subsection is another child of the actual section set in the map of the UaSettings class.
- Parameters
-
pSubSection | the actual subsection of the primary section. |
bool UaSettingsSection::contains |
( |
const UaUniString & |
sKey | ) |
|
Checks if the key sKey is existing in the section.
- Parameters
-
sKey | the key to search for. |
- Returns
- True if the key exists, false otherwise.
This method will return the actual section of the map.
If there is no section found NULL will be returned.
- Parameters
-
sGroup | the section to find in the map. |
- Returns
- NULL if the wanted section sGroup was not found, otherwise the found section sGroup.
Get the subsections (if available) for all sections of the INI file.
After getting the actual subsection - get its key-value pairs (if available).
- Parameters
-
sList | [out] the list where to write all subsections in. |
index | [out] the index for writing in the correct area. |
sPrefix | [in] the prefix "/" to separate the subsections from the key-value pair. |
Get the subkeys (if available) for all sections of the INI file.
- Parameters
-
sList | [out] the list where to write all subsections in. |
index | [out] the index for writing in the correct area. |
sPrefix | [in] the prefix "/" to separate the subsections from the key-value pair. |
Get the subsections (if available) for all sections of the INI file.
- Parameters
-
sList | [out] the list where to write all subsections in. |
index | [out] the index for writing in the correct area. |
sPrefix | [in] the prefix "/" to separate the subsections from the key-value pair. |
Getter method for the actual group/section.
Needed to get the actual section name.
- Returns
- the actual section name.
Get the "key" and "value" for the INI file.
These keys and values also represent the key and value structure in a map.
- Parameters
-
sList | [out] the list where to write all key values of in. |
index | [out] the index for writing in the correct area. |
sPrefix | [in] the prefix "/" to separate the subsections from the key-value pair. |
Getter method for the parent section.
Needed to get the parent of a subsection.
- Returns
- a pointer to the parent section.
This method iterates over all key-value pairs in the map and searches for the wanted value of the given key sKey.
- Parameters
-
sKey | the key to search its value for. |
sDefaultValue | the default value to return if the wanted value was not found. |
- Returns
- Either the found value or the default value if the wanted value was not found.
bool UaSettingsSection::removeKey |
( |
const UaUniString & |
sKey | ) |
|
This method removes a given key sKey from the map.
- Parameters
-
- Returns
- true if the key was successfully removed, false if not.
Sets the parent section to remember it if there is a subsection.
- Parameters
-
pParent | the pointer to the parent section. |
Writes a new value sValue with the given key sKey into the map.
It is not allowed to write the same key more than one time in the same section into the map.
- Parameters
-
sKey | the key to write into the map. |
sValue | the value of the given key to write into the map. |
The documentation for this class was generated from the following files:
- C:/work/uasdkcpp/src/uabase/uabasecpp/uasettingssection.h
- C:/work/uasdkcpp/src/uabase/uabasecpp/uasettingssection.cpp