Index: code/branches/doc/src/libraries/core/ConfigFileManager.cc
===================================================================
--- code/branches/doc/src/libraries/core/ConfigFileManager.cc	(revision 7290)
+++ code/branches/doc/src/libraries/core/ConfigFileManager.cc	(revision 7373)
@@ -27,4 +27,9 @@
  */
 
+/**
+    @file
+    @brief Implementation of ConfigFileManager and its helper classes.
+*/
+
 #include "ConfigFileManager.h"
 
@@ -43,5 +48,7 @@
     // ConfigFileEntryValue //
     //////////////////////////
-
+    /**
+        @brief Updates the string that will be stored in the file after one of it's components (name, value, comment) has changed.
+    */
     void ConfigFileEntryValue::update()
     {
@@ -63,4 +70,7 @@
     // ConfigFileEntryVectorValue //
     ////////////////////////////////
+    /**
+        @brief Updates the string that will be stored in the file after one of it's components (name, value, index, comment) has changed.
+    */
     void ConfigFileEntryVectorValue::update()
     {
@@ -73,4 +83,7 @@
     // ConfigFileSection //
     ///////////////////////
+    /**
+        @brief Destructor: Deletes all entries.
+    */
     ConfigFileSection::~ConfigFileSection()
     {
@@ -79,4 +92,10 @@
     }
 
+    /**
+        @brief Deletes all elements of a config vector if their index is greater or equal to @a startindex.
+
+        @param name         The name of the vector
+        @param startindex   The index of the first element that will be deleted
+    */
     void ConfigFileSection::deleteVectorEntries(const std::string& name, unsigned int startindex)
     {
@@ -95,4 +114,8 @@
     }
 
+    /**
+        @brief Returns the size of a config vector.
+        @param name     The name of the vector
+    */
     unsigned int ConfigFileSection::getVectorSize(const std::string& name) const
     {
@@ -108,4 +131,7 @@
     }
 
+    /**
+        @brief Returns the title and comment of the section as it will be stored in the file.
+    */
     std::string ConfigFileSection::getFileEntry() const
     {
@@ -116,4 +142,9 @@
     }
 
+    /**
+        @brief Returns the entry with given name (or NULL if it doesn't exist).
+
+        @param name     The name of the entry
+    */
     ConfigFileEntry* ConfigFileSection::getEntry(const std::string& name) const
     {
@@ -126,4 +157,10 @@
     }
 
+    /**
+        @brief Returns the entry of a vector element with given name and index (or NULL if it doesn't exist).
+
+        @param name     The name of the vector
+        @param index    The index of the element in the vector
+    */
     ConfigFileEntry* ConfigFileSection::getEntry(const std::string& name, unsigned int index) const
     {
@@ -136,4 +173,11 @@
     }
 
+    /**
+        @brief Returns the iterator to the entry with given name. If the entry doesn't exist, it is created using the fallback value.
+
+        @param name     The name of the entry
+        @param fallback The value that will be used if the entry doesn't exist
+        @param bString  If true, the value is treated as string which means some special treatment of special characters.
+    */
     std::list<ConfigFileEntry*>::iterator ConfigFileSection::getOrCreateEntryIterator(const std::string& name, const std::string& fallback, bool bString)
     {
@@ -152,4 +196,12 @@
     }
 
+    /**
+        @brief Returns the iterator to the entry of a vector element with given name and index. If the entry doesn't exist, it is created using the fallback value.
+
+        @param name     The name of the vector
+        @param index    The index of the element in the vector
+        @param fallback The value that will be used if the entry doesn't exist
+        @param bString  If true, the value is treated as string which means some special treatment of special characters.
+    */
     std::list<ConfigFileEntry*>::iterator ConfigFileSection::getOrCreateEntryIterator(const std::string& name, unsigned int index, const std::string& fallback, bool bString)
     {
@@ -178,4 +230,9 @@
     const char* ConfigFile::DEFAULT_CONFIG_FOLDER = "defaultConfig";
 
+    /**
+        @brief Constructor: Initializes the config file.
+        @param filename The file-name of this config file
+        @param bCopyFallbackFile If true, the default config file is copied into the config-directory before loading the file
+    */
     ConfigFile::ConfigFile(const std::string& filename, bool bCopyFallbackFile)
         : filename_(filename)
@@ -185,4 +242,7 @@
     }
 
+    /**
+        @brief Destructor: Deletes all sections and entries.
+    */
     ConfigFile::~ConfigFile()
     {
@@ -190,4 +250,7 @@
     }
 
+    /**
+        @brief Loads the config file from the hard-disk and reads the sections and their values.
+    */
     void ConfigFile::load()
     {
@@ -318,4 +381,7 @@
     }
 
+    /**
+        @brief Writes the sections and values to the hard-disk.
+    */
     void ConfigFile::save() const
     {
@@ -323,4 +389,7 @@
     }
 
+    /**
+        @brief Writes the sections and values to a given file on the hard-disk.
+    */
     void ConfigFile::saveAs(const std::string& filename) const
     {
@@ -354,4 +423,7 @@
     }
 
+    /**
+        @brief Deletes all sections (which again delete all their values) and clears the list of sections.
+    */
     void ConfigFile::clear()
     {
@@ -361,18 +433,11 @@
     }
 
-    const std::string& ConfigFile::getOrCreateValue(const std::string& section, const std::string& name, const std::string& fallback, bool bString)
-    {
-        const std::string& output = this->getOrCreateSection(section)->getOrCreateValue(name, fallback, bString);
-        this->saveIfUpdated();
-        return output;
-    }
-
-    const std::string& ConfigFile::getOrCreateValue(const std::string& section, const std::string& name, unsigned int index, const std::string& fallback, bool bString)
-    {
-        const std::string& output = this->getOrCreateSection(section)->getOrCreateValue(name, index, fallback, bString);
-        this->saveIfUpdated();
-        return output;
-    }
-
+    /**
+        @brief Deletes all elements of a config vector if their index is greater or equal to @a startindex.
+
+        @param section      The name of the section
+        @param name         The name of the vector
+        @param startindex   The index of the first element that will be deleted
+    */
     void ConfigFile::deleteVectorEntries(const std::string& section, const std::string& name, unsigned int startindex)
     {
@@ -384,4 +449,7 @@
     }
 
+    /**
+        @brief Returns a pointer to the section with given name (or NULL if the section doesn't exist).
+    */
     ConfigFileSection* ConfigFile::getSection(const std::string& section) const
     {
@@ -392,4 +460,7 @@
     }
 
+    /**
+        @brief Returns a pointer to the section with given name. If it doesn't exist, the section is created.
+    */
     ConfigFileSection* ConfigFile::getOrCreateSection(const std::string& section)
     {
@@ -403,4 +474,7 @@
     }
 
+    /**
+        @brief Saves the config file if it was updated (or if any of its sections were updated).
+    */
     void ConfigFile::saveIfUpdated()
     {
@@ -442,4 +516,7 @@
     SettingsConfigFile* SettingsConfigFile::singletonPtr_s = 0;
 
+    /**
+        @brief Constructor: Activates the console commands.
+    */
     SettingsConfigFile::SettingsConfigFile(const std::string& filename)
         : ConfigFile(filename)
@@ -452,4 +529,7 @@
     }
 
+    /**
+        @brief Destructor: Deactivates the console commands.
+    */
     SettingsConfigFile::~SettingsConfigFile()
     {
@@ -461,4 +541,7 @@
     }
 
+    /**
+        @brief Loads the config file and updates the @ref ConfigValueContainer "config value containers".
+    */
     void SettingsConfigFile::load()
     {
@@ -467,4 +550,7 @@
     }
 
+    /**
+        @brief Changes the file-name.
+    */
     void SettingsConfigFile::setFilename(const std::string& filename)
     {
@@ -472,4 +558,7 @@
     }
 
+    /**
+        @brief Registers a new @ref ConfigValueContainer "config value container".
+    */
     void SettingsConfigFile::addConfigValueContainer(ConfigValueContainer* container)
     {
@@ -481,4 +570,7 @@
     }
 
+    /**
+        @brief Unregisters a @ref ConfigValueContainer "config value container".
+    */
     void SettingsConfigFile::removeConfigValueContainer(ConfigValueContainer* container)
     {
@@ -500,6 +592,11 @@
     }
 
+    /**
+        @brief Updates all @ref ConfigValueContainer "config value containers".
+    */
     void SettingsConfigFile::updateConfigValues()
     {
+        // todo: can this be done more efficiently? looks like some identifiers will be updated multiple times.
+
         for (ContainerMap::const_iterator it = this->containers_.begin(); it != this->containers_.end(); ++it)
         {
@@ -509,4 +606,8 @@
     }
 
+    /**
+        @brief Removes entries and sections from the file that don't exist anymore (i.e. if there's no corresponding @ref ConfigValueContainer "config value container").
+        @param bCleanComments If true, comments are also removed from the file
+    */
     void SettingsConfigFile::clean(bool bCleanComments)
     {
@@ -558,4 +659,11 @@
     }
 
+    /**
+        @brief Console-command: Changes the value of an entry and stores it the file.
+
+        @param section  The section of the config value
+        @param entry    The name of the config value
+        @param value    The new value
+    */
     void SettingsConfigFile::config(const std::string& section, const std::string& entry, const std::string& value)
     {
@@ -564,4 +672,11 @@
     }
 
+    /**
+        @brief Console-command: Changes the value of an entry, but doesn't store it in the file (it's only a temporary change).
+
+        @param section  The section of the config value
+        @param entry    The name of the config value
+        @param value    The new value
+    */
     void SettingsConfigFile::tconfig(const std::string& section, const std::string& entry, const std::string& value)
     {
@@ -570,4 +685,12 @@
     }
 
+    /**
+        @brief Changes the value of an entry, depending on @a function, either by using "set" or "tset"
+
+        @param section  The section of the config value
+        @param entry    The name of the config value
+        @param value    The new value
+        @param function The function ("set" or "tset") that will be used to change the value.
+    */
     bool SettingsConfigFile::configImpl(const std::string& section, const std::string& entry, const std::string& value, bool (ConfigValueContainer::*function)(const MultiType&))
     {
@@ -586,4 +709,10 @@
     }
 
+    /**
+        @brief Console-command: Returns the value of a given entry.
+
+        @param section  The section of the config value
+        @param entry    The name of the config value
+    */
     std::string SettingsConfigFile::getConfig(const std::string& section, const std::string& entry)
     {
@@ -611,4 +740,5 @@
     ConfigFileManager* ConfigFileManager::singletonPtr_s = 0;
 
+    /// Constructor: Initializes the array of config files with NULL.
     ConfigFileManager::ConfigFileManager()
     {
@@ -616,4 +746,5 @@
     }
 
+    /// Destructor: Deletes the config files.
     ConfigFileManager::~ConfigFileManager()
     {
@@ -623,4 +754,5 @@
     }
 
+    /// Defines the file-name for the config file of a given type (settings, calibration, etc.).
     void ConfigFileManager::setFilename(ConfigFileType::Value type, const std::string& filename)
     {
