MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
Mezzanine::Resource::TextSettingsFile Class Reference
+ Collaboration diagram for Mezzanine::Resource::TextSettingsFile:

Public Types

typedef std::map< String,
SettingsMap * >::iterator 
SectionIterator
 
typedef std::multimap< String,
String >::iterator 
SettingsIterator
 
typedef std::multimap< String,
String
SettingsMap
 
typedef std::map< String,
SettingsMap * > 
SettingsSectionMap
 

Public Member Functions

 TextSettingsFile ()
 Class constructor.
 
 ~TextSettingsFile ()
 Class destructor.
 
void Clear ()
 Clears all data from this class.
 
std::vector< StringGetMultiSetting (const String &Key, const String &Section)
 Gets all the values of the specified setting in the specified section. More...
 
SectionIterator GetSectionBegin ()
 Gets an iterator to the first section in the file. More...
 
SectionIterator GetSectionEnd ()
 Gets an iterator to the last section in the file. More...
 
String GetSetting (const String &Key, const String &Section)
 Gets the value of the specified setting in the specified section. More...
 
SettingsIterator GetSettingsBegin (const String &Section)
 Gets an iterator to the first setting in the specified Section. More...
 
SettingsIterator GetSettingsEnd (const String &Section)
 Gets an iterator to the last setting in the specified Section. More...
 
void Load (const String &Filename, const String &Group, const String &Separators=" \t:=", bool TrimWhitespace=true)
 Loads and parses a text file. More...
 

Protected Attributes

String FileName
 
SettingsSectionMap Sections
 

Detailed Description

Definition at line 53 of file textsettingsfile.h.

Member Function Documentation

std::vector< String > Mezzanine::Resource::TextSettingsFile::GetMultiSetting ( const String Key,
const String Section 
)

Gets all the values of the specified setting in the specified section.

Parameters
KeyThe name of the setting to get the value for.
SectionThe name of the section to search for the Key.
Returns
Returns a vector of strings, all of which are the values of the specified setting.

Definition at line 138 of file textsettingsfile.cpp.

TextSettingsFile::SectionIterator Mezzanine::Resource::TextSettingsFile::GetSectionBegin ( )

Gets an iterator to the first section in the file.

Returns
Returns an iterator to the first section.

Definition at line 155 of file textsettingsfile.cpp.

TextSettingsFile::SectionIterator Mezzanine::Resource::TextSettingsFile::GetSectionEnd ( )

Gets an iterator to the last section in the file.

Returns
Returns an iterator to the last section.

Definition at line 160 of file textsettingsfile.cpp.

String Mezzanine::Resource::TextSettingsFile::GetSetting ( const String Key,
const String Section 
)

Gets the value of the specified setting in the specified section.

Parameters
KeyThe name of the setting to get the value for.
SectionThe name of the section to search for the Key.
Returns
Returns a string containing the value for the named setting.

Definition at line 121 of file textsettingsfile.cpp.

TextSettingsFile::SettingsIterator Mezzanine::Resource::TextSettingsFile::GetSettingsBegin ( const String Section)

Gets an iterator to the first setting in the specified Section.

Parameters
SectionThe name of the section desired.
Returns
Returns an iterator to the first setting in the named section.

Definition at line 165 of file textsettingsfile.cpp.

TextSettingsFile::SettingsIterator Mezzanine::Resource::TextSettingsFile::GetSettingsEnd ( const String Section)

Gets an iterator to the last setting in the specified Section.

Parameters
SectionThe name of the section desired.
Returns
Returns an iterator to the last setting in the named section.

Definition at line 176 of file textsettingsfile.cpp.

void Mezzanine::Resource::TextSettingsFile::Load ( const String Filename,
const String Group,
const String Separators = " \t:=",
bool  TrimWhitespace = true 
)

Loads and parses a text file.

Parameters
FilenameThe name of the file to load.
GroupThe resource group the file is in.
SeparatorsThe characters that should be observed when separating settings and their values on a single line.
TrimWhitespaceWhether or not to remove any white spaces before or after settings or their values.
Todo:
Once the resource system has been updated to be independant of Ogre's, this function needs to be updated to access our methods instead of theirs.

Definition at line 62 of file textsettingsfile.cpp.


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