Advanced Strategic Command
luacommandwriter.h
Go to the documentation of this file.
1 /***************************************************************************
2  * *
3  * This program is free software; you can redistribute it and/or modify *
4  * it under the terms of the GNU General Public License as published by *
5  * the Free Software Foundation; either version 2 of the License, or *
6  * (at your option) any later version. *
7  * *
8  ***************************************************************************/
9 
10 
11 #ifndef luacommandwriterH
12 #define luacommandwriterH
13 
14 
15 #include "actions/commandwriter.h"
16 #include "basestrm.h"
17 
19  int commandCounter;
20  protected:
21  void splitString( const ASCString& string );
22  virtual void outputLine( const ASCString& line ) = 0;
23  void writeHeader();
24  public:
26 
27  virtual void printCommand( const ASCString& command );
28  virtual void printComment( const ASCString& comment );
29  };
30 
32  virtual void outputLine( const ASCString& line );
33  public:
35  LuaCommandFileWriter ( const ASCString& filename );
36  };
37 
38  template <class C>
40  C& cont;
41  protected:
42  virtual void outputLine( const ASCString& line ) { cont.push_back( line ); };
43  public:
44  LuaCommandListWriter ( C& container ) : cont( container) { LuaCommandWriter::writeHeader(); };
45  };
46 
47 
48 #endif
virtual void outputLine(const ASCString &line)
LuaCommandFileWriter(const ASCString &filename)
The ASCString class provides an abstract way to manipulate strings.
Definition: ascstring.h:14
virtual void outputLine(const ASCString &line)=0
void splitString(const ASCString &string)
The interface for the various streams that ASC offers, like file and memory streams.
tn_file_buf_stream stream
LuaCommandListWriter(C &container)
virtual void printComment(const ASCString &comment)
void line(int x1, int y1, int x2, int y2, Uint8 actcol)
draws a simple line on the screen. Not very fast...
Definition: basegfx.cpp:181
virtual void printCommand(const ASCString &command)