neoWidgets
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
Classes | Public Member Functions | Protected Member Functions | List of all members
neo::iniConfig Class Reference

Configuration that writes to an ini-file. More...

#include <Config.h>

Inheritance diagram for neo::iniConfig:
Inheritance graph
[legend]

Public Member Functions

 iniConfig ()
 Unusable until Open() is called.
 
 iniConfig (const tstring &filepath)
 Calls Open()
 
bool Open (const tstring &filepath)
 Opens an ini file.
 
virtual bool Remove (const tstring &key)
 Remove a single value.
 
virtual bool RemoveEntireConfig ()
 Removes all values in the config, but the config can still used afterwards.
 
bool Save ()
 The config is saved in the destructor. This function allows to manually start the saving.
 
void SetCurrentSection (const tstring &section)
 Set the section used by Read() and Write() More...
 
- Public Member Functions inherited from neo::Config
bool Read (const tstring &key, tstring &result) const
 Basic read function.
 
template<typename T >
bool Read (const tstring &key, T &result) const
 Extendable version of Read. More...
 
void RestoreWindowPosition (const tstring &key, HWND window)
 Convenience function for window position.
 
void SaveWindowPosition (const tstring &key, HWND window)
 Convenience function for window position.
 
bool Write (const tstring &key, const tstring &value)
 Basic write function.
 
template<typename T >
bool Write (const tstring &key, const T &value)
 Extendable version of Write. More...
 

Protected Member Functions

bool _GetStringImp (const tstring &key, tstring &result) const
 Every config value is internally saved as a string.
 
bool _SetStringImp (const tstring &key, const tstring &value)
 Every config value is internally saved as a string.
 

Additional Inherited Members

- Static Protected Member Functions inherited from neo::Config
static tstring FromUtf8 (const std::string &text)
 All config should be saved as UTF-8 for portability.
 
static std::string ToUtf8 (const tstring &text)
 All config should be saved as UTF-8 for portability.
 

Detailed Description

Configuration that writes to an ini-file.

The ini file reading/writing is built from scratch because the PrivateProfile functions from Windows don't support UTF-8.

Member Function Documentation

void neo::iniConfig::SetCurrentSection ( const tstring &  section)
inline

Set the section used by Read() and Write()

ini files are devided into sections. This function must be called at least once before Read() or Write() are called. Otherwise these operations will not know where to look for keys.


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