Overview

ALPreferences allows access to xml preference files.
A preference is defined as follows :
pParams[0] Name of the preference;
pParams[1] Description of the preference;
pParams[2] The value of the preference (can contain other preferences);
pParams[3] (optional) The name of the data when inserted into memory.

Methods

AL::ALValue readPrefFile (const string& fileName, const bool& autoGenerateMemoryNames)

Reads all preferences from an xml files and stores them in an ALValue.

fileName

Name of the module associate to the preference.

autoGenerateMemoryNames

If true a memory name will be generated for each non-array preference.

Returns

array reprenting the whole file.

void writePrefFile (const string& fileName, const AL::ALValue& prefs, const bool& ignoreMemoryNames)

Writes all preferences from ALValue to an xml file.

fileName

Name of the module associate to the preference.

prefs

array reprenting the whole file.

ignoreMemoryNames

If true all memory names will be removed before saving.

bool saveToMemory (const AL::ALValue& prefs)

Writes all preferences from ALValue to an xml file.

prefs

array reprenting the whole file.

Returns

True upon success.


Methods inherited from ALModule

void exit ()

Exits and unregisters the module.

string version ()

Returns the version of the module.

Returns

A string containing the version of the module.

bool ping ()

Just a ping. Always returns true

Returns

returns true

vector<string> getMethodList ()

Retrieves the module's method list.

Returns

An array of method names.

AL::ALValue getMethodHelp (const string& methodName)

Retrieves a method's description.

methodName

The name of the method.

Returns

A structure containing the method's description.

AL::ALValue getModuleHelp ()

Retrieves the module's description.

Returns

A structure describing the module.

string getBrokerName ()

Gets the name of the parent broker.

Returns

The name of the parent broker.

string getUsage (const string& name)

Gets the method usage string. This summarise how to use the method.

name

The name of the method.

Returns

A string that summarises the usage of the method.


Copyright © 2010 Aldebaran Robotics - All rights reserved