6 #ifndef _INC_cIniSection_H
7 #define _INC_cIniSection_H
36 , m_bStartedSection(false)
83 static const StrLen_t k_SECTION_SIZE_MAX = (256 * 1024);
85 static const StrLen_t k_LINE_LEN_MAX = (4 * 1024);
100 void MoveLineOffsets(
ITERATE_t iLineStart, INT_PTR iDiffChars);
114 bool isStripped() const noexcept
117 return m_bStripComments;
123 if (m_iLinesUsed <= 0)
125 return m_iBufferUsed;
130 if (m_iLinesUsed <= 0)
147 return m_ppLines[iLine];
159 int FindIntForKey(
const IniChar_t* pszKey,
int iDefault = 0)
const;
163 bool IsValidLines()
const;
169 return SetLine(iLine,
nullptr);
177 return AddKeyArg(pszKey, StrArg<IniChar_t>(iArg));
182 return SetKeyArg(pszKey, StrArg<IniChar_t>(iArg));
184 void AllocComplete();
210 , m_sSectionTitle(sSectionTitle)
218 return m_sSectionTitle;
222 return cString(get_SectionTitle());
238 return IsSectionTypeMatch(m_sSectionTitle, pszSectionType);
255 , m_FilePos(0, iLine)
260 , m_FilePos(rSectionCopy.m_FilePos)
#define GRAYCORE_LINK
Definition: GrayCore.h:47
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
#define IS_INDEX_BAD(i, q)
cast the (likely) int to unsigned to check for negatives.
Definition: Index.h:34
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
#define ASSERT(exp)
Definition: cDebugAssert.h:87
#define UNITTEST_FRIEND(n)
Define this in the class body to be unit tested. Allow the unit test to access private/protected stuf...
Definition: cUnitTestDecl.h:17
Definition: cIniFile.h:22
Definition: cIniSection.h:71
bool m_bStripComments
has been stripped of blank lines, comments, leading and trailing line spaces.
Definition: cIniSection.h:89
StrLen_t get_BufferSize() const noexcept
Definition: cIniSection.h:127
ITERATE_t get_LineQty() const noexcept
Definition: cIniSection.h:135
IniChar_t * GetLineEnum(ITERATE_t iLine=0) const noexcept
Definition: cIniSection.h:140
ITERATE_t AddKeyInt(const IniChar_t *pszKey, int iArg)
Definition: cIniSection.h:175
ITERATE_t SetKeyInt(const IniChar_t *pszKey, int iArg)
Definition: cIniSection.h:180
StrLen_t get_BufferUsed() const noexcept
Definition: cIniSection.h:120
bool RemoveLine(ITERATE_t iLine)
Definition: cIniSection.h:167
Definition: cIniSection.h:244
int get_HashCode() const noexcept
Definition: cIniSection.h:267
virtual ~cIniSectionEntry()
Definition: cIniSection.h:263
cTextPos m_FilePos
Where in parent/source file is this? for error reporting. 1 based. ITERATE_t.
Definition: cIniSection.h:250
cIniSectionEntry(const cIniSectionEntry &rSectionCopy)
Definition: cIniSection.h:258
cIniSectionEntry(cStringI sSectionTitle, bool bStripComments=false, int iLine=0)
Definition: cIniSection.h:253
Definition: cIniSection.h:195
cStringI m_sSectionTitle
"SECTIONTYPE SECTIONNAME" = everything that was inside [] without the []
Definition: cIniSection.h:201
const cStringI & get_SectionTitle() const noexcept
Definition: cIniSection.h:215
cIniSection(cStringI sSectionTitle, bool bStripComments=false)
Definition: cIniSection.h:208
cString get_Name() const noexcept
Definition: cIniSection.h:220
static bool __stdcall IsSectionTypeRoot(const IniChar_t *pszSection) noexcept
Definition: cIniSection.h:227
bool IsSectionType(const IniChar_t *pszSectionType) const noexcept
Definition: cIniSection.h:236
cIniSection(bool bStripComments=false) noexcept
Definition: cIniSection.h:204
Definition: cIniSection.h:24
bool m_bStartedSection
Must write a newline to close the previous section when we start a new one.
Definition: cIniSection.h:31
cIniWriter(cStreamOutput *pOut)
Definition: cIniSection.h:34
cStreamOutput * m_pOut
write out to this stream.
Definition: cIniSection.h:30
size_t get_DataSize() const noexcept
Definition: cMem.h:344
Definition: cRefPtr.h:225
Definition: cStream.h:126
Definition: cTextPos.h:18
ITERATE_t get_Line1() const noexcept
< Get 1 based line.
Definition: cTextPos.h:69
< The main namespace for all Core functions.
Definition: GrayCore.cpp:14
const StrLen_t k_StrLen_UNK
use the default/current length of the string argument.
Definition: StrConst.h:34
int StrLen_t
the length of a string in chars (bytes for UTF8, wchar_t for UNICODE). or offset in characters....
Definition: StrConst.h:32
UINT32 STRP_MASK_t
bit mask of STRP_TYPE_
Definition: StrT.h:64
class __DECL_IMPORT cStreamOutput
Definition: cString.h:27
@ STRP_END_WHITE
trim end whitespace off token.
Definition: StrT.h:55
@ STRP_MERGE_CRNL
merge "\r\n" (may also be separators.) (newline = linefeed)
Definition: StrT.h:59
@ STRP_EMPTY_STOP
Stop when we hit an empty token.
Definition: StrT.h:61
@ STRP_START_WHITE
remove start whitespace from each token
Definition: StrT.h:53
int ITERATE_t
like size_t but signed
Definition: Index.h:28
char IniChar_t
char format even on UNICODE system! Screw M$, INI files should ALWAYS have UTF8 contents
Definition: cIniBase.h:17
int IPROPIDX_t
enumerate known properties for some interface/object/class. similar to SCRIPTPROPID_t
Definition: cIniBase.h:16
cRefPtr< cIniSectionEntry > cIniSectionEntryPtr
Definition: cIniSection.h:272
cStringT< GChar_t > cString
Definition: cString.h:636
Definition: cIniBase.h:35
Definition: cIniBase.h:28
Definition: cIniBase.h:21
static bool IsNullOrEmpty(const TYPE *pszStr) noexcept
Definition: StrT.h:102
Definition: cIniSection.h:53