Orxonox: orxonox::ConfigFile Class Reference

# orxonox::ConfigFile Class Reference

`#include <src/core/ConfigFileManager.h>`

List of all members.

## Public Member Functions

void | clean (bool bCleanComments=false)
void | clear ()
| ConfigFile (const std::string &filename, ConfigFileType type)
void | deleteVectorEntries (const std::string &section, const std::string &name, unsigned int startindex=0)
const std::string & | getFilename ()
std::string | getValue (const std::string &section, const std::string &name, unsigned int index, const std::string &fallback, bool bString)
std::string | getValue (const std::string &section, const std::string &name, const std::string &fallback, bool bString)
unsigned int | getVectorSize (const std::string &section, const std::string &name)
void | load (bool bCreateIfNotExisting=true)
void | save () const
void | saveAs (const std::string &filename)
void | setValue (const std::string &section, const std::string &name, unsigned int index, const std::string &value, bool bString)
void | setValue (const std::string &section, const std::string &name, const std::string &value, bool bString)
void | updateConfigValues ()
| ~ConfigFile ()

## Private Member Functions

ConfigFileSection * | getSection (const std::string &section)
void | saveIfUpdated ()

## Private Attributes

bool | bUpdated_
std::string | filename_
std::list< ConfigFileSection * > | sections_
ConfigFileType | type_

## Constructor & Destructor Documentation

orxonox::ConfigFile::ConfigFile | ( | const std::string & | filename,
|  | ConfigFileType | type |
| ) |  |  | `[inline]`

orxonox::ConfigFile::~ConfigFile | ( |  | ) |

References clear().

## Member Function Documentation

void orxonox::ConfigFile::clean | ( | bool | bCleanComments = `false` | ) |

References orxonox::Identifier::getIdentifierMap(), orxonox::Identifier::getIdentifierMapEnd(), save(), and sections_.

Referenced by orxonox::ConfigFileManager::clean().

void orxonox::ConfigFile::clear | ( |  | ) |

References sections_.

Referenced by load(), and ~ConfigFile().

void orxonox::ConfigFile::deleteVectorEntries | ( | const std::string & | section,
|  | const std::string & | name,
|  | unsigned int | startindex = `0` |
| ) |  |  | `[inline]`

const std::string& orxonox::ConfigFile::getFilename | ( |  | ) | `[inline]`

ConfigFileSection * orxonox::ConfigFile::getSection | ( | const std::string & | section | ) | `[private]`

References bUpdated_, and sections_.

std::string orxonox::ConfigFile::getValue | ( | const std::string & | section,
|  | const std::string & | name,
|  | unsigned int | index,
|  | const std::string & | fallback,
|  | bool | bString |
| ) |  |  | `[inline]`

std::string orxonox::ConfigFile::getValue | ( | const std::string & | section,
|  | const std::string & | name,
|  | const std::string & | fallback,
|  | bool | bString |
| ) |  |  | `[inline]`

unsigned int orxonox::ConfigFile::getVectorSize | ( | const std::string & | section,
|  | const std::string & | name |
| ) |  |  | `[inline]`

void orxonox::ConfigFile::load | ( | bool | bCreateIfNotExisting = `true` | ) |

References clear(), orxonox::convertValue(), COUT, filename_, orxonox::Core::getConfigPath(), orxonox::ConfigFileSection::getEntries(), orxonox::ConfigFileSection::getEntryIterator(), orxonox::Core::getMediaPath(), orxonox::getNextCommentPosition(), orxonox::getStripped(), orxonox::isBetweenQuotes(), orxonox::isComment(), orxonox::isEmpty(), orxonox::removeTrailingWhitespaces(), save(), sections_, and updateConfigValues().

Referenced by orxonox::ConfigFileManager::load().

void orxonox::ConfigFile::save | ( |  | ) | const

References COUT, filename_, orxonox::Core::getConfigPath(), and sections_.

Referenced by clean(), load(), orxonox::ConfigFileManager::save(), saveAs(), and saveIfUpdated().

void orxonox::ConfigFile::saveAs | ( | const std::string & | filename | ) |

References filename_, and save().

Referenced by orxonox::ConfigFileManager::saveAs().

void orxonox::ConfigFile::saveIfUpdated | ( |  | ) | `[private]`

References bUpdated_, save(), and sections_.

void orxonox::ConfigFile::setValue | ( | const std::string & | section,
|  | const std::string & | name,
|  | unsigned int | index,
|  | const std::string & | value,
|  | bool | bString |
| ) |  |  | `[inline]`

void orxonox::ConfigFile::setValue | ( | const std::string & | section,
|  | const std::string & | name,
|  | const std::string & | value,
|  | bool | bString |
| ) |  |  | `[inline]`

void orxonox::ConfigFile::updateConfigValues | ( |  | ) |

References orxonox::Identifier::getIdentifierMapBegin(), orxonox::Identifier::getIdentifierMapEnd(), orxonox::ConfigFileType::Settings, and type_.

Referenced by load(), and orxonox::ConfigFileManager::updateConfigValues().

## Member Data Documentation

bool orxonox::ConfigFile::bUpdated_`[private]`

Referenced by getSection(), and saveIfUpdated().

std::string orxonox::ConfigFile::filename_`[private]`

Referenced by load(), save(), and saveAs().

std::list<ConfigFileSection*> orxonox::ConfigFile::sections_`[private]`

Referenced by clean(), clear(), getSection(), load(), save(), and saveIfUpdated().

ConfigFileType orxonox::ConfigFile::type_`[private]`

Referenced by updateConfigValues().

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

- src/core/ConfigFileManager.h
- src/core/ConfigFileManager.cc