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, String > | mSettings

## 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 35 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 94 of file OgreConfigFile.cpp. References mSettings, Ogre::String, 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 79 of file OgreConfigFile.cpp. References mSettings, and Ogre::String. Referenced by Ogre::TerrainSceneManager::loadConfig(), Ogre::Root::loadPlugins(), and Ogre::Root::restoreConfig().

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::TerrainSceneManager::loadConfig(), and Ogre::Root::restoreConfig().

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

| Definition at line 39 of file OgreConfigFile.cpp. References Except, mSettings, and Ogre::String. Referenced by Ogre::TerrainSceneManager::loadConfig(), Ogre::Root::loadPlugins(), and Ogre::Root::restoreConfig().

## 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:

- OgreConfigFile.h
- OgreConfigFile.cpp

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:50:51 2004