]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - contrib/bobtoolz/ScriptParser.h
netradiant: strip 16-bit png to 8-bit, fix #153
[xonotic/netradiant.git] / contrib / bobtoolz / ScriptParser.h
1 /*
2    BobToolz plugin for GtkRadiant
3    Copyright (C) 2001 Gordon Biggans
4
5    This library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Lesser General Public
7    License as published by the Free Software Foundation; either
8    version 2.1 of the License, or (at your option) any later version.
9
10    This library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Lesser General Public License for more details.
14
15    You should have received a copy of the GNU Lesser General Public
16    License along with this library; if not, write to the Free Software
17    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19
20
21 #ifndef _SCRIPTPARSER_H_
22 #define _SCRIPTPARSER_H_
23
24 //#include "interfaces/IScriptParser.h"
25
26 const int SP_MAX_BREAKCHARS = 16;
27
28 class CScriptParser //: public IScriptParser
29 {
30 public:
31 CScriptParser( void );
32 ~CScriptParser( void );
33 private:
34 char m_breakChars[SP_MAX_BREAKCHARS];
35 char*   m_pScript;
36 char*   m_pScriptSection;
37 char*   m_pLastScriptSection;
38 char*   m_pToken;
39
40 void SkipWhitespace( bool* pbNewLines );
41 void ClearBuffer( void );
42 const char* MakeToken( const char* pToken );
43 bool IsBreakChar( char c );
44 public:
45 const char* GetToken( bool bAllowLinebreaks );
46 void SkipBracedSection( void );
47 void SkipRestOfLine( void );
48 void UndoGetToken( void );
49 void ResetParseSession( void );
50
51 char* GetBufferCopy( void );
52 int GetTokenOffset( void );
53
54 void LoadScript( const char* pScript );
55 void SetScript( char* pScript );
56
57 void AddBreakChar( char c );
58 private:
59 };
60
61 #endif