Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members |
#include <ConfigFile.h>
Public Member Functions | |
ConfigFile () | |
std::list< std::string > | getMultiSetting (const std::string &key) |
Gets all settings from the file with the named key. | |
std::string | getSetting (const std::string &key) |
Gets the first setting from the file with the named key. | |
std::multimap< std::string, std::string >::const_iterator | getSettingsBegin () |
std::multimap< std::string, std::string >::const_iterator | getSettingsEnd () |
bool | load (const std::string &filename, const std::string &separators="\t:=") |
bool | save (const std::string &filename, const c8 separator= '\t') |
void | setSetting (const std::string &key, const std::string &value) |
~ConfigFile () | |
Protected Attributes | |
std::multimap< std::string, std::string > | mSettings |
Class for quickly loading settings from a text file. This class is designed to quickly parse a simple file containing key/value pairs, mainly for use in configuration settings. By default the key/values pairs are tokenised based on a separator of Tab, the colon (:) or equals (=) character. Each key - value pair must end in a carriage return.
core::ConfigFile::ConfigFile | ( | ) |
core::ConfigFile::~ConfigFile | ( | ) |
References mSettings.
std::list< std::string > core::ConfigFile::getMultiSetting | ( | const std::string & | key | ) |
Gets all settings from the file with the named key.
References mSettings.
Referenced by engine::PluginManager::createPlugins().
std::string core::ConfigFile::getSetting | ( | const std::string & | key | ) |
Gets the first setting from the file with the named key.
References mSettings, and core::STRING_BLANK.
Referenced by engine::PluginManager::createPlugins(), and engine::EngineSettings::loadOptions().
std::multimap< std::string, std::string >::const_iterator core::ConfigFile::getSettingsBegin | ( | ) |
References mSettings.
Referenced by resource::ResourceManager::setPaths().
std::multimap< std::string, std::string >::const_iterator core::ConfigFile::getSettingsEnd | ( | ) |
References mSettings.
Referenced by resource::ResourceManager::setPaths().
bool core::ConfigFile::load | ( | const std::string & | filename, |
const std::string & | separators = "\t:=" |
||
) |
References mSettings, and core::stringTrim().
Referenced by engine::PluginManager::createPlugins(), engine::EngineSettings::loadOptions(), and resource::ResourceManager::setPaths().
bool core::ConfigFile::save | ( | const std::string & | filename, |
const c8 | separator = '\t' |
||
) |
References mSettings.
Referenced by engine::EngineSettings::saveOptions().
void core::ConfigFile::setSetting | ( | const std::string & | key, |
const std::string & | value | ||
) |
References mSettings.
Referenced by engine::EngineSettings::saveOptions().
std::multimap<std::string, std::string> core::ConfigFile::mSettings [protected] |
Referenced by getMultiSetting(), getSetting(), getSettingsBegin(), getSettingsEnd(), load(), save(), setSetting(), and ~ConfigFile().
The KG Game Engine
Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:07 by
Doxygen
(1.7.4)
|