Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cScriptSection Class Reference

#include <cScriptSection.h>

Inheritance diagram for GrayLib::cScriptSection:
Gray::cIniSectionEntry IScriptableGetter IScriptableEnumerator Gray::cRefBase Gray::cIniSection IUnknown Gray::cIniSectionData Gray::IIniBaseEnumerator Gray::IIniBaseGetter Gray::IIniBaseSetter Gray::cIniReader

Public Member Functions

 cScriptSection (cStringT< IniChar_t > sSectionTitle="", bool bStripped=false, int iLine=0)
 
 cScriptSection (const cScriptSection &rSectionCopy)
 
virtual ~cScriptSection ()
 
ITERATE_t FindTriggerNumber (int iTrigVal) const
 Find attached triggers like "@NAME". More...
 
ITERATE_t FindTriggerEnum (int iEnum) const
 
STDMETHOD() s_GetEnum (ITERATE_t i, OUT cStringA &rsPropName, OUT cVariant &vValRet)
 
STDMETHOD() s_GetByName (const ATOMCHAR_t *pszPropName, OUT cVariant &vValRet)
 
- Public Member Functions inherited from Gray::cIniSectionEntry
 cIniSectionEntry (cStringI sSectionTitle, bool bStripComments=false, int iLine=0)
 
 cIniSectionEntry (const cIniSectionEntry &rSectionCopy)
 
virtual ~cIniSectionEntry ()
 
int get_HashCode () const noexcept
 
- Public Member Functions inherited from Gray::cRefBase
 cRefBase (int iRefCount=0) noexcept
 
virtual ~cRefBase ()
 
int get_RefCount () const noexcept
 
HASHCODE_t get_HashCode () const noexcept
 
 STDMETHOD_ (HASHCODE_t, get_HashCodeX)() const noexcept
 
virtual void onFinalRelease ()
 
bool isValidObj () const noexcept
 
 STDMETHOD_ (ULONG, AddRef)(void) override
 
 STDMETHOD_ (ULONG, Release)(void) override
 
STDMETHOD() QueryInterface (const IID &riid, void __RPC_FAR *__RPC_FAR *ppvObject) override
 
void IncRefCount ()
 
void DecRefCount ()
 
bool isStaticConstruct () const noexcept
 
void StaticConstruct ()
 
void StaticDestruct ()
 
bool isDestructing () noexcept
 
void SetDestructing ()
 
- Public Member Functions inherited from Gray::cIniSection
 cIniSection (bool bStripComments=false) noexcept
 
 cIniSection (cStringI sSectionTitle, bool bStripComments=false)
 
 cIniSection (const cIniSection &rSectionCopy)
 
const cStringIget_SectionTitle () const noexcept
 
cString get_Name () const noexcept
 
HRESULT WriteSection (cStreamOutput &file)
 
bool IsSectionType (const IniChar_t *pszSectionType) const noexcept
 
- Public Member Functions inherited from Gray::cIniSectionData
 cIniSectionData (bool bStripComments=false) noexcept
 
virtual ~cIniSectionData ()
 
void DisposeThis ()
 
bool isStripped () const noexcept
 
StrLen_t get_BufferUsed () const noexcept
 
StrLen_t get_BufferSize () const noexcept
 
ITERATE_t get_LineQty () const noexcept
 
IniChar_tGetLineEnum (ITERATE_t iLine=0) const noexcept
 
ITERATE_t FindTriggerName (const IniChar_t *pszTrigName) const
 
virtual HRESULT PropEnum (IPROPIDX_t ePropIdx, OUT cStringI &rsValue, cStringI *psKey=nullptr) const override
 
void ClearLineQty ()
 
ITERATE_t FindKeyLine (const IniChar_t *pszKeyName, bool bPrefixOnly=false) const
 Find a key in the section (key=args) More...
 
const IniChar_tFindKeyLinePtr (const IniChar_t *pszKey) const
 
const IniChar_tFindArgForKey (const IniChar_t *pszKey, const IniChar_t *pszDefault=nullptr) const
 
int FindIntForKey (const IniChar_t *pszKey, int iDefault=0) const
 
virtual HRESULT PropGet (const IniChar_t *pszPropTag, OUT cStringI &rsValue) const override
 
bool IsValidLines () const
 
void SetLinesCopy (const cIniSectionData &section)
 
ITERATE_t AddLine (const IniChar_t *pszLine)
 
bool SetLine (ITERATE_t iLine, const IniChar_t *pszLine=nullptr)
 
bool RemoveLine (ITERATE_t iLine)
 
ITERATE_t AddKeyArg (const IniChar_t *pszKey, const IniChar_t *pszArg)
 
ITERATE_t AddKeyInt (const IniChar_t *pszKey, int iArg)
 
ITERATE_t SetKeyArg (const IniChar_t *pszKey, const IniChar_t *pszArg)
 
ITERATE_t SetKeyInt (const IniChar_t *pszKey, int iArg)
 
void AllocComplete ()
 
virtual HRESULT PropSet (const IniChar_t *pszPropTag, const IniChar_t *pszValue) override
 
StrLen_t SetLinesParse (const IniChar_t *pszData, StrLen_t iLen=k_StrLen_UNK, const IniChar_t *pszSep=nullptr, STRP_MASK_t uFlags=(STRP_START_WHITE|STRP_MERGE_CRNL|STRP_END_WHITE|STRP_EMPTY_STOP))
 
cStringA GetStringAll (const IniChar_t *pszSep=nullptr) const
 
HRESULT ReadSectionData (cStringA &rsSectionNext, cStreamInput &stream, bool bStripComments)
 
HRESULT WriteSectionData (cStreamOutput &file)
 

Additional Inherited Members

- Static Public Member Functions inherited from Gray::cIniSection
static cStringI __stdcall GetSectionTitleParse (cStringI sSectionTitle, cStringI *psPropTag)
 
static bool __stdcall IsSectionTypeRoot (const IniChar_t *pszSection) noexcept
 
static bool __stdcall IsSectionTypeMatch (const IniChar_t *pszSection1, const IniChar_t *pszSection2) noexcept
 
- Static Public Member Functions inherited from Gray::cIniSectionData
static StrLen_t __stdcall IsLineTrigger (const IniChar_t *pszLine)
 
static StrLen_t __stdcall MakeLine (IniChar_t *pszTmp, StrLen_t iSizeMax, const IniChar_t *pszKey, const IniChar_t *pszArg, IniChar_t chSep='=')
 
- Static Public Member Functions inherited from Gray::cIniReader
static bool __stdcall IsSectionHeader (const IniChar_t *pszLine)
 
static bool __stdcall IsLineComment (const IniChar_t *pszLine)
 
static IniChar_t *__stdcall FindLineArg (const IniChar_t *pszLine, bool bAllowSpace=false)
 
static StrLen_t __stdcall FindScriptLineEnd (const IniChar_t *pLineStr)
 
static cStringI __stdcall GetLineParse2 (const IniChar_t *pszLine, IniChar_t **ppszArgs=nullptr)
 
static cStringI __stdcall GetLineParse3 (const IniChar_t *pszLine, OUT cStringI &rsArgs)
 
- Public Attributes inherited from Gray::cIniSectionEntry
cTextPos m_FilePos
 Where in parent/source file is this? for error reporting. 1 based. ITERATE_t. More...
 
- Static Public Attributes inherited from Gray::cIniSectionData
static const StrLen_t k_SECTION_SIZE_MAX = (256 * 1024)
 (chars) max size for whole section. (Windows Me/98/95 = 32K for INI) More...
 
static const ITERATE_t k_LINE_QTY_MAX = (8 * 1024)
 max number of lines i support. (per section) More...
 
static const StrLen_t k_LINE_LEN_MAX = (4 * 1024)
 max size for a single line (in chars). More...
 
static const StrLen_t k_LINE_LEN_DEF = (1024)
 suggested/guessed/average size for lines (in chars). for alloc guessing. More...
 
- Protected Member Functions inherited from Gray::cIniSectionData
IniChar_tAllocBuffer (StrLen_t nSizeChars)
 For raw access to the m_Buffer. More...
 
void AllocLines (ITERATE_t iLinesAlloc)
 
IniChar_tAllocBeginMin (StrLen_t nSizeChars)
 
- Protected Attributes inherited from Gray::cIniSection
cStringI m_sSectionTitle
 "SECTIONTYPE SECTIONNAME" = everything that was inside [] without the [] More...
 
- Protected Attributes inherited from Gray::cIniSectionData
bool m_bStripComments
 has been stripped of blank lines, comments, leading and trailing line spaces. More...
 

Detailed Description

Hold the array of lines of script. One function/command per line. It typically has 'Tag=Val' at the start and may contain triggers/event handlers and scripts at the end. This is often a [section Block] in a script/INI file OR from a database entry.

Constructor & Destructor Documentation

◆ cScriptSection() [1/2]

GrayLib::cScriptSection::cScriptSection ( cStringT< IniChar_t sSectionTitle = "",
bool  bStripped = false,
int  iLine = 0 
)

◆ cScriptSection() [2/2]

GrayLib::cScriptSection::cScriptSection ( const cScriptSection rSectionCopy)

copy constructor.

◆ ~cScriptSection()

GrayLib::cScriptSection::~cScriptSection ( )
virtual

Member Function Documentation

◆ FindTriggerEnum()

ITERATE_t GrayLib::cScriptSection::FindTriggerEnum ( int  iEnum) const

In the case of menus they entries are not always unique.

Returns
line number. -1 = not found.

◆ FindTriggerNumber()

ITERATE_t GrayLib::cScriptSection::FindTriggerNumber ( int  iTrigVal) const

Find attached triggers like "@NAME".

In the case of dialogs. each button has a unique number. Find a numeric trigger.

Returns
line number. -1 = not found.

◆ s_GetByName()

HRESULT GrayLib::cScriptSection::s_GetByName ( const ATOMCHAR_t pszPropName,
OUT cVariant vValRet 
)

◆ s_GetEnum()

HRESULT GrayLib::cScriptSection::s_GetEnum ( ITERATE_t  i,
OUT cStringA rsPropName,
OUT cVariant vValRet 
)

IScriptableGetter iLine = line in this section.


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