Added an SMC stream reader to ITextParser (bug 3530, r=pred).

This commit is contained in:
David Anderson
2009-02-01 20:31:27 -05:00
parent 21770ff10f
commit cef6a2e389
3 changed files with 78 additions and 43 deletions
+20 -1
View File
@@ -43,7 +43,7 @@ namespace SourceMod
{
#define SMINTERFACE_TEXTPARSERS_NAME "ITextParsers"
#define SMINTERFACE_TEXTPARSERS_VERSION 3
#define SMINTERFACE_TEXTPARSERS_VERSION 4
/**
* The INI file format is defined as:
@@ -399,12 +399,31 @@ namespace SourceMod
* @param states Optional pointer to store last known states.
* @param buffer Error message buffer.
* @param maxsize Maximum size of the error buffer.
* @return Error code.
*/
virtual SMCError ParseSMCFile(const char *file,
ITextListener_SMC *smc_listener,
SMCStates *states,
char *buffer,
size_t maxsize) =0;
/**
* @brief Parses a raw UTF8 stream as an SMC file.
*
* @param stream Memory containing data.
* @param length Number of bytes in the stream.
* @param smc_listener Event handler for reading file.
* @param states Optional pointer to store last known states.
* @param buffer Error message buffer.
* @param maxsize Maximum size of the error buffer.
* @return Error code.
*/
virtual SMCError ParseSMCStream(const char *stream,
size_t length,
ITextListener_SMC *smc_listener,
SMCStates *states,
char *buffer,
size_t maxsize) =0;
};
inline unsigned int _GetUTF8CharBytes(const char *stream)