![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cAppConfig.h>
Public Member Functions | |
cAppConfigX (cStringF sProfileName, cStringF sRegistryKey="") | |
~cAppConfigX () | |
HRESULT | GetOpenIni (bool bCreate=true) |
HRESULT | FlushX () |
HRESULT | EnumConfig (const IniChar_t *pszSection, OUT cArrayString< IniChar_t > &rArray) |
cString | GetConfigStr (const IniChar_t *pszSection, const IniChar_t *pszEntry, const GChar_t *pszDefault=nullptr) |
UINT | GetConfigUInt (const IniChar_t *pszSection, const IniChar_t *pszEntry, int iDefault=0) |
bool | GetConfigVar (const IniChar_t *pszSection, const IniChar_t *pszEntry, OUT cVariant &rvVal) |
bool | WriteConfigStr (const IniChar_t *pszSection, const IniChar_t *pszEntry, const GChar_t *pszVal) |
bool | WriteConfigInt (const IniChar_t *pszSection, const IniChar_t *pszEntry, int iVal) |
bool | WriteConfigVar (const IniChar_t *pszSection, const IniChar_t *pszEntry, const cVariant &vVal) |
Protected Attributes | |
cStringF | m_sProfileName |
The full path to the profile specific to this app. (or just "Appname" for a m_sRegistryKey ) More... | |
cIniFile | m_IniFile |
Cached open INI file. (if we use it) More... | |
bool | m_bIniFileModified |
If we are using the m_IniFile file vs the registry then we need to write it. More... | |
A config that might be the config for this application or may be to some other assembly/module/etc A config that might be from an INI file or registry. cIniFile or cRegKey. Use cAppConfigSection to isolate a single section. Similar to what is exposed by CWinApp:
decide if we get config info from a file or the registry.
GrayLib::cAppConfigX::~cAppConfigX | ( | ) |
HRESULT GrayLib::cAppConfigX::EnumConfig | ( | const IniChar_t * | pszSection, |
OUT cArrayString< IniChar_t > & | rArray | ||
) |
List all the config sections (pszSection = nullptr) or the keys in a pszSection.
HRESULT GrayLib::cAppConfigX::FlushX | ( | ) |
Write/Save if there is anything to write.
cString GrayLib::cAppConfigX::GetConfigStr | ( | const IniChar_t * | pszSection, |
const IniChar_t * | pszEntry, | ||
const GChar_t * | pszDefault = nullptr |
||
) |
like MFC GetProfileString() but with 2 additions
UINT GrayLib::cAppConfigX::GetConfigUInt | ( | const IniChar_t * | pszSection, |
const IniChar_t * | pszEntry, | ||
int | iDefault = 0 |
||
) |
bool GrayLib::cAppConfigX::GetConfigVar | ( | const IniChar_t * | pszSection, |
const IniChar_t * | pszEntry, | ||
OUT cVariant & | rvVal | ||
) |
HRESULT GrayLib::cAppConfigX::GetOpenIni | ( | bool | bCreate = true | ) |
Get an open INI file if it exits. else create it if bCreate.
bool GrayLib::cAppConfigX::WriteConfigInt | ( | const IniChar_t * | pszSection, |
const IniChar_t * | pszEntry, | ||
int | iVal | ||
) |
bool GrayLib::cAppConfigX::WriteConfigStr | ( | const IniChar_t * | pszSection, |
const IniChar_t * | pszEntry, | ||
const GChar_t * | pszVal | ||
) |
Write string to config file or registry. like MFC WriteProfileString
bool GrayLib::cAppConfigX::WriteConfigVar | ( | const IniChar_t * | pszSection, |
const IniChar_t * | pszEntry, | ||
const cVariant & | vVal | ||
) |
|
protected |
If we are using the m_IniFile file vs the registry then we need to write it.
|
protected |
Cached open INI file. (if we use it)
|
protected |
The full path to the profile specific to this app. (or just "Appname" for a m_sRegistryKey )