#include <MercuryINI.h>
Collaboration diagram for MercuryINI:
Public Member Functions | |
MercuryINI () | |
MercuryINI (const MString &sFileName, bool bSaveOnExit) | |
~MercuryINI () | |
bool | Open (const MString &sFileName, bool bAddIncludes=true, bool bClearToStart=false) |
Open a INI from a file; bAddIncludes specifies whether or not to look at [AdditionalFiles], bClearToStart states whether or not all data should be erased when starting. | |
bool | Load (const char *sIniText, long slen) |
Load an INI from a given c-style string. | |
bool | Load (const MString &sIniText) |
Load an INI from a given string. | |
bool | Save (const MString sFileName="") |
Save the INI file. | |
void | Dump (MString &data) |
Dump the file into the incoming MString. | |
long | Dump (char *&toDump) |
Dump the file into then c-style string, this will also allocate ram. | |
void | EnumerateKeys (MVector< MString > &keys) |
Enumerate all keys in this ini file into keys. | |
void | EnumerateValues (const MString &key, MVector< MString > &values) |
Enumerate all values in the given key to values. | |
void | EnumerateValues (const MString &key, std::map< MString, MString > &values) |
Enumerate all values in the given key to a map. | |
MString | GetValueS (const MString &key, const MString &value, MString sDefaultValue="", bool bMakeValIfNoExist=false) |
Return string value, blank if non-existant. | |
long | GetValueI (const MString &key, const MString &value, long iDefaultValue=0, bool bMakeValIfNoExist=false) |
Return long value, 0 if non-existant. | |
float | GetValueF (const MString &key, const MString &value, float fDefaultValue=0, bool bMakeValIfNoExist=false) |
Return float value, 0 if non-existant. | |
bool | GetValueB (const MString &key, const MString &value, bool bDefaultValue=0, bool bMakeValIfNoExist=false) |
Return bool value, 0 if non-existant. | |
bool | GetValue (const MString &key, const MString &value, MString &data) |
Return value through data, false if non-existant. | |
void | SetValue (const MString &key, const MString &value, const MString &data) |
Set a value. | |
bool | RemoveValue (const MString &key, const MString &value) |
Remove a value. | |
MString | GetLastError () |
Get the last error. | |
void | ToggleSaveOnExit (bool toggle) |
Private Attributes | |
bool | m_bSaveOnExit |
[internal] save all of the values when this ini file is destroyed | |
MString | m_sLastError |
MString | m_sFileName |
std::map< MString, std::map< MString, MString > > | m_mDatas |
std::map< MString, bool > | m_mLoaded |
Definition at line 9 of file MercuryINI.h.
MercuryINI::MercuryINI | ( | ) | [inline] |
Definition at line 12 of file MercuryINI.h.
MercuryINI::MercuryINI | ( | const MString & | sFileName, | |
bool | bSaveOnExit | |||
) |
Definition at line 9 of file MercuryINI.cpp.
MercuryINI::~MercuryINI | ( | ) |
Definition at line 15 of file MercuryINI.cpp.
bool MercuryINI::Open | ( | const MString & | sFileName, | |
bool | bAddIncludes = true , |
|||
bool | bClearToStart = false | |||
) |
Open a INI from a file; bAddIncludes specifies whether or not to look at [AdditionalFiles], bClearToStart states whether or not all data should be erased when starting.
Definition at line 23 of file MercuryINI.cpp.
bool MercuryINI::Load | ( | const char * | sIniText, | |
long | slen | |||
) |
bool MercuryINI::Load | ( | const MString & | sIniText | ) | [inline] |
bool MercuryINI::Save | ( | const MString | sFileName = "" |
) |
void MercuryINI::Dump | ( | MString & | data | ) |
long MercuryINI::Dump | ( | char *& | toDump | ) |
Dump the file into then c-style string, this will also allocate ram.
Definition at line 106 of file MercuryINI.cpp.
MString MercuryINI::GetLastError | ( | ) | [inline] |
void MercuryINI::ToggleSaveOnExit | ( | bool | toggle | ) | [inline] |
Definition at line 58 of file MercuryINI.h.
bool MercuryINI::m_bSaveOnExit [private] |
[internal] save all of the values when this ini file is destroyed
Definition at line 62 of file MercuryINI.h.
MString MercuryINI::m_sLastError [private] |
Definition at line 63 of file MercuryINI.h.
MString MercuryINI::m_sFileName [private] |
Definition at line 64 of file MercuryINI.h.
std::map< MString, std::map< MString, MString > > MercuryINI::m_mDatas [private] |
Definition at line 65 of file MercuryINI.h.
std::map< MString, bool > MercuryINI::m_mLoaded [private] |
Definition at line 66 of file MercuryINI.h.