ALPreferences API

NAOqi Core - Overview | API


Namespace : AL

#include <alproxies/alpreferencesproxy.h>

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
#include <alproxies/alpreferencesproxy.h>

Method list

As any module, this module inherits methods from ALModule API. It also has the following specific methods:

class ALPreferencesProxy

Methods

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

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

Parameters:
  • 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.

bool ALPreferencesProxy::saveToMemory(const AL::ALValue& prefs)

Writes all preferences from ALValue to individual memory keys.

Parameters:
  • prefs – array reprenting the whole file.
Returns:

True upon success.

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

Writes all preferences from ALValue to an xml file.

Parameters:
  • 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.