2 Copyright (C) 2001-2006, William Joseph.
5 This file is part of GtkRadiant.
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #if !defined( INCLUDED_ISCRIPLIB_H )
23 #define INCLUDED_ISCRIPLIB_H
26 /// \brief Token input/output stream module.
29 #include "generic/constant.h"
36 virtual void release() = 0;
37 virtual void nextLine() = 0;
38 virtual const char* getToken() = 0;
39 virtual void ungetToken() = 0;
40 virtual std::size_t getLine() const = 0;
41 virtual std::size_t getColumn() const = 0;
44 class TextInputStream;
49 virtual void release() = 0;
50 virtual void nextLine() = 0;
51 virtual void writeToken( const char* token ) = 0;
52 virtual void writeString( const char* string ) = 0;
53 virtual void writeInteger( int i ) = 0;
54 virtual void writeUnsigned( std::size_t i ) = 0;
55 virtual void writeFloat( double f ) = 0;
58 class TextOutputStream;
60 struct _QERScripLibTable
62 INTEGER_CONSTANT( Version, 1 );
63 STRING_CONSTANT( Name, "scriptlib" );
65 Tokeniser& ( *m_pfnNewScriptTokeniser )( TextInputStream & istream );
66 Tokeniser& ( *m_pfnNewSimpleTokeniser )( TextInputStream & istream );
67 TokenWriter& ( *m_pfnNewSimpleTokenWriter )( TextOutputStream & ostream );
70 #include "modulesystem.h"
72 template<typename Type>
74 typedef GlobalModule<_QERScripLibTable> GlobalScripLibModule;
76 template<typename Type>
77 class GlobalModuleRef;
78 typedef GlobalModuleRef<_QERScripLibTable> GlobalScripLibModuleRef;
80 inline _QERScripLibTable& GlobalScriptLibrary(){
81 return GlobalScripLibModule::getTable();