ArgScript::IBlock class

This parser represents a block of ArgScript lines.

A block begins when a line with the keyword is read, and it ends when a line with the reserved keyword 'end' is found. The lines inside the block will be read using the parsers contained inside this IBlock, or using the parsers in the FormatParser.

Base classes

class IParser
This interface represents a command or block that can be parsed in ArgScript.

Constructors, destructors, conversion operators

IBlock()
~IBlock() virtual

Public functions

void SetData(FormatParser* formatParser, void* data) override
Sets the data and FormatParser of this parser.
void OnBlockEnd(bool arg_0) virtual
Event called when the 'end' keyword is found, and therefore the block is finished.
void AddParser(const char* pKeyword, IParser* pParser) virtual
Maps the given IParser to the specified keyword.
auto GetParser(const char* pKeyword) -> IParser* virtual
Gets the IParser that is mapped to the given keyword.

Protected variables

hash_map<string, intrusive_ptr<IParser>> mParsers
void* field_30

Function documentation

void ArgScript::IBlock::SetData(FormatParser* formatParser, void* data) override

Sets the data and FormatParser of this parser.

For blocks, this should be used to add any necessary parsers, since it is called when the IBlock is added to a FormatParser or another block.

void ArgScript::IBlock::AddParser(const char* pKeyword, IParser* pParser) virtual

Maps the given IParser to the specified keyword.

When a line with that keyword is found inside this block, the IParser given will be used.

IParser* ArgScript::IBlock::GetParser(const char* pKeyword) virtual

Gets the IParser that is mapped to the given keyword.

Parameters
pKeyword The keyword string.