![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cIniFile.h>
Public Member Functions | |
cIniFile () | |
virtual | ~cIniFile () |
bool | isRead () const |
HRESULT | ReadIniStream (cStreamInput &s, bool bStripComments=false) |
HRESULT | ReadIniFile (const FILECHAR_t *pszFilePath, bool bStripComments=false) |
HRESULT | WriteIniFile (const FILECHAR_t *pszFilePath) const |
cIniSectionEntryPtr | EnumSection (ITERATE_t i=0) const |
virtual HRESULT | PropEnum (IPROPIDX_t ePropIdx, OUT cStringI &rsValue, cStringI *psPropTag=nullptr) const override |
cIniSectionEntryPtr | FindSection (const IniChar_t *pszSectionTitle=nullptr, bool bPrefix=false) const |
const IniChar_t * | FindKeyLinePtr (const IniChar_t *pszSectionTitle, const IniChar_t *pszKey) const |
virtual cIniSectionEntryPtr | AddSection (const IniChar_t *pszSectionTitle=nullptr, bool bStripped=false, int iLine=0) |
HRESULT | SetKeyLine (const IniChar_t *pszSectionTitle, const IniChar_t *pszKey, const IniChar_t *pszLine) |
HRESULT | SetKeyArg (const IniChar_t *pszSectionTitle, const IniChar_t *pszKey, const IniChar_t *pszArg) |
Friends | |
class | cIniFileTests |
Very simple interface to read/write an ".INI" MIME_EXT_ini format file. Reads the whole file into memory so we may parse it further. Allows initial data keys without [SECTIONTYPE Sectionnamedata] (unlike windows)
Gray::cIniFile::cIniFile | ( | ) |
|
virtual |
|
virtual |
Create a new section in the file. don't care if the key exists or not. dupes are OK.
|
inline |
const IniChar_t * Gray::cIniFile::FindKeyLinePtr | ( | const IniChar_t * | pszSectionTitle, |
const IniChar_t * | pszKey | ||
) | const |
Find a line in the [pszSectionTitle] with a key looking like pszKey=
cIniSectionEntryPtr Gray::cIniFile::FindSection | ( | const IniChar_t * | pszSectionTitle = nullptr , |
bool | bPrefix = false |
||
) | const |
Assume file has been read into memory already.
|
inline |
Was this read ?
|
overridevirtual |
IIniBaseEnumerator Enumerate the sections.
Implements Gray::IIniBaseEnumerator.
HRESULT Gray::cIniFile::ReadIniFile | ( | const FILECHAR_t * | pszFilePath, |
bool | bStripComments = false |
||
) |
Open and read a whole INI file.
HRESULT Gray::cIniFile::ReadIniStream | ( | cStreamInput & | s, |
bool | bStripComments = false |
||
) |
Read in all the sections in the file.
HRESULT Gray::cIniFile::SetKeyArg | ( | const IniChar_t * | pszSectionTitle, |
const IniChar_t * | pszKey, | ||
const IniChar_t * | pszArg | ||
) |
OK for pszSectionTitle == nullptr
HRESULT Gray::cIniFile::SetKeyLine | ( | const IniChar_t * | pszSectionTitle, |
const IniChar_t * | pszKey, | ||
const IniChar_t * | pszLine | ||
) |
HRESULT Gray::cIniFile::WriteIniFile | ( | const FILECHAR_t * | pszFilePath | ) | const |
Write the whole INI file. preserve line comments (if the didn't get stripped via bStripComments).
|
friend |