2 * ===============================================================
3 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
4 * ===============================================================
6 * This file is not open source and may not be copied without explicit
7 * written permission of AlliedModders LLC. This file may not be redistributed
8 * in whole or significant part.
9 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
14 #ifndef _INCLUDE_SOURCEMOD_TEXTPARSERS_H_
15 #define _INCLUDE_SOURCEMOD_TEXTPARSERS_H_
17 #include <ITextParsers.h>
18 #include "sm_globals.h"
20 using namespace SourceMod;
22 inline unsigned int _GetUTF8CharBytes(const char *stream)
24 unsigned char c = *(unsigned char *)stream;
41 * @param void * IN: Stream pointer
42 * @param char * IN/OUT: Stream buffer
43 * @param size_t IN: Maximum size of buffer
44 * @param unsigned int * OUT: Number of bytes read (0 = end of stream)
45 * @return True on success, false on failure
47 typedef bool (*STREAMREADER)(void *, char *, size_t, unsigned int *);
55 public: //SMGlobalClass
56 void OnSourceModAllInitialized();
58 bool ParseFile_INI(const char *file,
59 ITextListener_INI *ini_listener,
63 SMCParseError ParseFile_SMC(const char *file,
64 ITextListener_SMC *smc_listener,
68 unsigned int GetUTF8CharBytes(const char *stream);
70 const char *GetSMCErrorString(SMCParseError err);
72 SMCParseError ParseString_SMC(const char *stream,
73 ITextListener_SMC *smc,
76 SMCParseError ParseStream_SMC(void *stream,
78 ITextListener_SMC *smc,
84 extern CTextParsers g_TextParser;
86 #endif //_INCLUDE_SOURCEMOD_TEXTPARSERS_H_