.. _alpreferences-api: ALPreferences API ================= :ref:`Overview ` | API Namespace : **AL** .. code-block:: cpp #include 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 .. code-block:: cpp #include Method list ----------- .. cpp:class:: ALPreferencesProxy * Methods: * :cpp:func:`ALPreferencesProxy::readPrefFile` * :cpp:func:`ALPreferencesProxy::saveToMemory` * :cpp:func:`ALPreferencesProxy::writePrefFile` .. seealso:: * :ref:`Methods inherited from ALModule ` Methods ------- .. cpp:function:: AL::ALValue ALPreferencesProxy::readPrefFile(const std::string& fileName,const bool& autoGenerateMemoryNames) Reads all preferences from an xml files and stores them in an ALValue. :param fileName: Name of the module associate to the preference. :param autoGenerateMemoryNames: If true a memory name will be generated for each non-array preference. :return: array reprenting the whole file. .. cpp:function:: bool ALPreferencesProxy::saveToMemory(const AL::ALValue& prefs) Writes all preferences from ALValue to individual memory keys. :param prefs: array reprenting the whole file. :return: True upon success. .. cpp:function:: void ALPreferencesProxy::writePrefFile(const std::string& fileName,const AL::ALValue& prefs,const bool& ignoreMemoryNames) Writes all preferences from ALValue to an xml file. :param fileName: Name of the module associate to the preference. :param prefs: array reprenting the whole file. :param ignoreMemoryNames: If true all memory names will be removed before saving.