Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::ConfigFile Class Reference

Class for quickly loading settings from a text file. More...

#include <OgreConfigFile.h>

List of all members.

Public Types

typedef MapIterator< std::multimap<
String, String > > 
SettingsIterator

Public Methods

 ConfigFile ()
void load (const String &filename, const String &separators="\t:=", bool trimWhitespace=true)
String getSetting (const String &key) const
 Gets the first setting from the file with the named key.

StringVector getMultiSetting (const String &key) const
 Gets all settings from the file with the named key.

SettingsIterator getSettingsIterator (void)
 Gets an iterator for stepping through all the keys / values in the file.


Protected Attributes

std::multimap< String, StringmSettings


Detailed Description

Class for quickly loading settings from a text file.

Remarks:
This class is designed to quickly parse a simple file containing key/value pairs, mainly for use in configuration settings.

This is a very simplified approach, no multiple values per key are allowed, no grouping or context is being kept etc.

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.

Definition at line 48 of file OgreConfigFile.h.


Member Typedef Documentation

typedef MapIterator< std::multimap<String, String> > Ogre::ConfigFile::SettingsIterator
 

Definition at line 60 of file OgreConfigFile.h.

Referenced by getSettingsIterator().


Constructor & Destructor Documentation

Ogre::ConfigFile::ConfigFile  
 

Definition at line 33 of file OgreConfigFile.cpp.


Member Function Documentation

StringVector Ogre::ConfigFile::getMultiSetting const String   key const
 

Gets all settings from the file with the named key.

Definition at line 95 of file OgreConfigFile.cpp.

References mSettings, and Ogre::StringVector.

Referenced by Ogre::Root::loadPlugins().

String Ogre::ConfigFile::getSetting const String   key const
 

Gets the first setting from the file with the named key.

Definition at line 80 of file OgreConfigFile.cpp.

References mSettings.

Referenced by Ogre::Root::loadPlugins(), Ogre::Root::restoreConfig(), and Ogre::TerrainSceneManager::setWorldGeometry().

ConfigFile::SettingsIterator Ogre::ConfigFile::getSettingsIterator void   
 

Gets an iterator for stepping through all the keys / values in the file.

Definition at line 114 of file OgreConfigFile.cpp.

References mSettings, and SettingsIterator.

Referenced by Ogre::Root::restoreConfig().

void Ogre::ConfigFile::load const String   filename,
const String   separators = "\t:=",
bool    trimWhitespace = true
 

Definition at line 37 of file OgreConfigFile.cpp.

References Except, mSettings, and Ogre::String::trim().

Referenced by Ogre::Root::loadPlugins(), Ogre::Root::restoreConfig(), and Ogre::TerrainSceneManager::setWorldGeometry().


Member Data Documentation

std::multimap<String, String> Ogre::ConfigFile::mSettings [protected]
 

Definition at line 65 of file OgreConfigFile.h.

Referenced by getMultiSetting(), getSetting(), getSettingsIterator(), and load().


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

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:17:07 2004