rrIniFile

class IniFile

Public Functions

IniFile(const std::string &fName = "", bool autoLoad = false, bool autoSave = false)
virtual ~IniFile()
inline size_t GetNumberOfSections()
inline IniSection *GetSection(int i)
inline IniSection *GetSection(size_t i)
inline std::string GetFilePath()
inline std::string GetFileName()
inline std::string GetFullFileName()
bool SetFilePath(const std::string &path)
bool Load(const std::string &fName = "")
IniSection *LoadSection(const std::string &theSection)
bool Save(ios_base::openmode openMode = std::ios::out | std::ios::trunc)
inline bool UnLoad()
inline bool WasItFound()
bool SectionExists(const std::string &section)

Boolean indicating if the last key was found in the ini file.

std::string ReadValue(const std::string &Key, const std::string &Section = "")
std::string ReadString(const std::string &Key, const std::string &Section = "", const std::string &def_val = "")
double ReadDouble(const std::string &Key, const std::string &Section = "", double def_value = 0)
inline float ReadFloat(const std::string &Key, const std::string &Section = "", double def_value = 0)
int ReadInteger(const std::string &Key, const std::string &Section = "", int def_value = 0)
bool ReadBool(const std::string &Key, const std::string &Section = "", bool def_value = false)
bool WriteValue(const std::string &Key, const std::string &Value, const std::string &Comment = "", const std::string &Section = "")
bool WriteFloat(const std::string &Key, double value, const std::string &Comment = "", const std::string &Section = "")
bool WriteInteger(const std::string &Key, int nValue, const std::string &Comment = "", const std::string &Section = "")
bool WriteBool(const std::string &Key, bool bValue, const std::string &Comment = "", const std::string &Section = "")
inline bool WriteString(const std::string &Key, const std::string &Value, const std::string &Comment = "", const std::string &Section = "")
bool WriteNonKey(const std::string &nonKey, const std::string &Section = "")
bool SetKeyComment(const std::string &Key, const std::string &Comment, const std::string &Section = "")
bool SetSectionComment(const std::string &Section, const std::string &Comment)
bool DeleteKey(const std::string &Key, const std::string &FromSection = "")
bool DeleteSection(const std::string &Section)
bool DeleteSectionsWithKeyValue(const std::string &key, const std::string &value)
bool CreateKey(const std::string &Key, const std::string &Value, const std::string &Comment = "", const std::string &Section = "")
bool CreateSection(const std::string &Section, const std::string &Comment = "")
bool CreateSection(const std::string &Section, const std::string &Comment, KeyList Keys)
size_t SectionCount()
size_t KeyCount()
size_t KeyCount(const std::string &section)
void Clear()
void SetFileName(const std::string &fName)
std::string CommentStr(std::string &Comment)
IniKey *GetKey(const std::string &Key, const std::string &Section)
IniSection *GetSection(const std::string &Section, bool create = false)
IniSection *GetSection(const unsigned int secNr)
bool ClearSection(const std::string &section)
inline bool IsModified()

Public Members

int mFlags

Protected Attributes

SectionList mSections
FileName mIniFileName
bool mIsDirty
bool mWasFound
bool mAutoSave

Private Functions

std::string GetNextWord(std::string &CommandLine)
std::string Trim(std::string &Str)
int WriteLine(std::fstream &stream, const char *fmt, ...)

Private Members

const int mAutoCreateSections
const int mAutoCreateKeys
std::string mCommentIndicators
const std::string mEqualIndicator
const std::string mWhiteSpace