UA Server SDK C++ Bundle  1.3.3.206
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
UaSettingsSection Class Reference

The UaSettingsSection class provides persistent platform-independent application settings. More...

#include <uasettingssection.h>

Public Member Functions

 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...
 
UaSettingsSectionfindSettingsSection (const UaUniString &sGroup)
 This method will return the actual section of the map. More...
 
void addSettingsSubSection (UaSettingsSection *pSubSection)
 Add s a new sub section to the map. More...
 
void setParentSection (UaSettingsSection *pParent)
 Sets the parent section to remember it, if there is a sub section. More...
 
UaSettingsSectiongetParentSection ()
 Getter method for the parent section. More...
 
void getAllSubSections (UaUniStringList *sList, int *index, UaUniString sPrefix)
 Get the sub sections (if available) for all sections of the INI file. More...
 
void getAllSubKeys (UaUniStringList *sList, int *index, UaUniString sPrefix)
 Get the sub keys (if available) for all sections of the INI file. More...
 
void getAllKeyValueStrings (UaUniStringList *sList, int *index, UaUniString sPrefix)
 Get the sub sections (if available) for all sections of the INI file. More...
 
void getKeyValuePairs (UaUniStringList *sList, int *index, UaUniString sPrefix)
 Get the "key" and "value" for the INI file. More...
 
UaUniString getGroup ()
 Getter method for the actual group / section. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

UaSettingsSection::UaSettingsSection ( const UaUniString sGroup)

Construction with value.

Parameters
sGroupthe name of a section to write into the map.

Member Function Documentation

void UaSettingsSection::addSettingsSubSection ( UaSettingsSection pSubSection)

Add s a new sub section to the map.

This sub section is another child of the actual section set in the map of the UaSettings class.

Parameters
sGroupthe actual group / section where the subsection should be added.
pSubSectionthe actual subsection of the primary section.
bool UaSettingsSection::contains ( const UaUniString sKey)

Checks if the key sKey is existing in the section.

Parameters
sKeythe key to search for.
Returns
True if the key exists, false otherwise.
UaSettingsSection * UaSettingsSection::findSettingsSection ( const UaUniString sGroup)

This method will return the actual section of the map.

If there is no section found NULL will be returned.

Parameters
sGroupthe section to find in the map.
Returns
NULL if the wanted section sGroup was not found, otherwise the found section sGroup.
void UaSettingsSection::getAllKeyValueStrings ( UaUniStringList sList,
int *  index,
UaUniString  sPrefix 
)

Get the sub sections (if available) for all sections of the INI file.

After getting the actual sub section - get its key - value pairs (if available).

Parameters
sList[out] the list where to write all sub sections in.
index[out] the index for writing in the correct area.
sPrefix[in] the prefix "/" to separate the subsections from the key - value pair.
void UaSettingsSection::getAllSubKeys ( UaUniStringList sList,
int *  index,
UaUniString  sPrefix 
)

Get the sub keys (if available) for all sections of the INI file.

Parameters
sList[out] the list where to write all sub sections in.
index[out] the index for writing in the correct area.
sPrefix[in] the prefix "/" to separate the subsections from the key - value pair.
void UaSettingsSection::getAllSubSections ( UaUniStringList sList,
int *  index,
UaUniString  sPrefix 
)

Get the sub sections (if available) for all sections of the INI file.

Parameters
sList[out] the list where to write all sub sections in.
index[out] the index for writing in the correct area.
sPrefix[in] the prefix "/" to separate the subsections from the key - value pair.
UaUniString UaSettingsSection::getGroup ( )

Getter method for the actual group / section.

Needed to get the actual section name.

Returns
the actual section name.
void UaSettingsSection::getKeyValuePairs ( UaUniStringList sList,
int *  index,
UaUniString  sPrefix 
)

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.
UaSettingsSection * UaSettingsSection::getParentSection ( )

Getter method for the parent section.

Needed to get the parent of a sub section.

Returns
a pointer to the parent section.
UaUniString UaSettingsSection::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.

Parameters
sKeythe key to search its value for.
sDefaultValuethe 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
sKeythe key to remove.
Returns
true if the key was successfully removed, false if not.
void UaSettingsSection::setParentSection ( UaSettingsSection pParent)

Sets the parent section to remember it, if there is a sub section.

Parameters
pParentthe pointer to the parent section.
void UaSettingsSection::setValue ( const UaUniString sKey,
const UaUniString sValue 
)

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
sKeythe key to write into the map.
sValuethe value of the given key to write into the map.

The documentation for this class was generated from the following files: