32 #ifndef _INCLUDE_SOURCEMOD_TEXTPARSERS_INTERFACE_H_
33 #define _INCLUDE_SOURCEMOD_TEXTPARSERS_INTERFACE_H_
45 #define SMINTERFACE_TEXTPARSERS_NAME "ITextParsers"
46 #define SMINTERFACE_TEXTPARSERS_VERSION 4
98 return SMINTERFACE_TEXTPARSERS_VERSION;
116 unsigned int *curtok)
138 unsigned int *curtok)
212 SMCError_StreamError,
214 SMCError_InvalidSection1,
215 SMCError_InvalidSection2,
216 SMCError_InvalidSection3,
217 SMCError_InvalidSection4,
218 SMCError_InvalidSection5,
219 SMCError_InvalidTokens,
220 SMCError_TokenOverflow,
221 SMCError_InvalidProperty1,
244 return SMINTERFACE_TEXTPARSERS_VERSION;
273 return SMCResult_Continue;
287 return SMCResult_Continue;
298 return SMCResult_Continue;
311 return SMCResult_Continue;
323 return SMINTERFACE_TEXTPARSERS_NAME;
327 return SMINTERFACE_TEXTPARSERS_VERSION;
350 unsigned int *col) =0;
429 inline unsigned int _GetUTF8CharBytes(
const char *stream)
431 unsigned char c = *(
unsigned char *)stream;
450 #endif //_INCLUDE_SOURCEMOD_TEXTPARSERS_INTERFACE_H_
States for line/column.
Definition: ITextParsers.h:227
Describes the events available for reading an SMC stream.
Definition: ITextParsers.h:236
virtual bool IsWhitespace(const char *stream)=0
Returns whether the first multi-byte character in the given stream is a whitespace character...
virtual SMCResult ReadSMC_KeyValue(const SMCStates *states, const char *key, const char *value)
Called when encountering a key/value pair in a section.
Definition: ITextParsers.h:285
virtual void ReadSMC_ParseStart()
Called when starting parsing.
Definition: ITextParsers.h:250
virtual bool IsVersionCompatible(unsigned int version)
Must return whether the requested version number is backwards compatible. Note: This can be overridde...
Definition: ITextParsers.h:329
virtual bool ReadINI_NewSection(const char *section, bool invalid_tokens, bool close_bracket, bool extra_tokens, unsigned int *curtok)
Called when a new section is encountered in an INI file.
Definition: ITextParsers.h:112
Defines the Share System, responsible for shared resources and dependencies.
virtual SMCResult ReadSMC_RawLine(const SMCStates *states, const char *line)
Called after an input line has been preprocessed.
Definition: ITextParsers.h:309
unsigned int line
Definition: ITextParsers.h:229
Defines the base functionality required by a shared interface.
Definition: IShareSys.h:92
Contains parse events for INI files.
Definition: ITextParsers.h:90
virtual SMCResult ReadSMC_NewSection(const SMCStates *states, const char *name)
Called when entering a new section.
Definition: ITextParsers.h:271
virtual bool ReadINI_RawLine(const char *line, unsigned int *curtok)
Called after a line has been preprocessed, if it has text.
Definition: ITextParsers.h:150
virtual const char * GetInterfaceName()
Must return a string defining the interface's unique name.
Definition: ITextParsers.h:321
virtual SMCError ParseFile_SMC(const char *file, ITextListener_SMC *smc_listener, SMCStates *states)=0
Parses an SMC-format text file. Note that the parser makes every effort to obey broken syntax...
virtual bool ReadINI_KeyValue(const char *key, const char *value, bool invalid_tokens, bool equal_token, bool quotes, unsigned int *curtok)
Called when encountering a key/value pair in an INI file.
Definition: ITextParsers.h:133
virtual unsigned int GetTextParserVersion2()
Returns version number.
Definition: ITextParsers.h:242
Contains various text stream parsing functions.
Definition: ITextParsers.h:318
virtual bool IsVersionCompatible(unsigned int version)
Must return whether the requested version number is backwards compatible. Note: This can be overridde...
Definition: IShareSys.h:112
Definition: IAdminSystem.h:63
virtual bool ParseFile_INI(const char *file, ITextListener_INI *ini_listener, unsigned int *line, unsigned int *col)=0
Parses an INI-format file.
virtual void ReadSMC_ParseEnd(bool halted, bool failed)
Called when ending parsing.
Definition: ITextParsers.h:260
virtual const char * GetSMCErrorString(SMCError err)=0
Converts an SMCError to a string.
unsigned int col
Definition: ITextParsers.h:230
virtual unsigned int GetInterfaceVersion()
Must return an integer defining the interface's version.
Definition: ITextParsers.h:325
virtual SMCError ParseSMCFile(const char *file, ITextListener_SMC *smc_listener, SMCStates *states, char *buffer, size_t maxsize)=0
Same as ParseFile_SMC, but with an extended error buffer.
virtual unsigned int GetUTF8CharBytes(const char *stream)=0
Returns the number of bytes that a multi-byte character contains in a UTF-8 stream. If the current character is not multi-byte, the function returns 1.
virtual SMCResult ReadSMC_LeavingSection(const SMCStates *states)
Called when leaving the current section.
Definition: ITextParsers.h:296
virtual unsigned int GetTextParserVersion1()
Returns version number.
Definition: ITextParsers.h:96
virtual SMCError ParseSMCStream(const char *stream, size_t length, ITextListener_SMC *smc_listener, SMCStates *states, char *buffer, size_t maxsize)=0
Parses a raw UTF8 stream as an SMC file.