Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
Public Member Functions | Protected Attributes
core::ConfigFile Class Reference

#include <ConfigFile.h>

List of all members.

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 > 

Detailed Description

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.

Constructor & Destructor Documentation

core::ConfigFile::ConfigFile ( )
core::ConfigFile::~ConfigFile ( )

References mSettings.

Member Function Documentation

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 ( )
std::multimap< std::string, std::string >::const_iterator core::ConfigFile::getSettingsEnd ( )
bool core::ConfigFile::load ( const std::string &  filename,
const std::string &  separators = "\t:=" 
bool core::ConfigFile::save ( const std::string &  filename,
const c8  separator = '\t' 
void core::ConfigFile::setSetting ( const std::string &  key,
const std::string &  value 

Member Data Documentation

std::multimap<std::string, std::string> core::ConfigFile::mSettings [protected]

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

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:07 by Doxygen (1.7.4)