luacommandwriter.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *   This program is free software; you can redistribute it and/or modify  *
00004  *   it under the terms of the GNU General Public License as published by  *
00005  *   the Free Software Foundation; either version 2 of the License, or     *
00006  *   (at your option) any later version.                                   *
00007  *                                                                         *
00008  ***************************************************************************/
00009 
00010 
00011 #ifndef luacommandwriterH
00012 #define  luacommandwriterH
00013 
00014 
00015 #include "actions/commandwriter.h"
00016 #include "basestrm.h"
00017 
00018    class LuaCommandWriter : public AbstractCommandWriter {
00019          int commandCounter;
00020       protected:
00021          void splitString( const ASCString& string );
00022          virtual void outputLine( const ASCString& line ) = 0;
00023          void writeHeader();
00024       public:
00025          LuaCommandWriter();
00026                
00027          virtual void printCommand( const ASCString& command );
00028          virtual void printComment( const ASCString& comment );
00029    };
00030 
00031    class LuaCommandFileWriter : public LuaCommandWriter {
00032          virtual void outputLine( const ASCString& line );
00033       public:
00034          tn_file_buf_stream stream;
00035          LuaCommandFileWriter ( const ASCString& filename );
00036    };
00037    
00038    template <class C>
00039          class LuaCommandListWriter : public LuaCommandWriter {
00040          C& cont;
00041       protected:
00042          virtual void outputLine( const ASCString& line ) { cont.push_back( line ); }; 
00043       public:
00044          LuaCommandListWriter ( C& container ) : cont( container)  { LuaCommandWriter::writeHeader(); };
00045    };
00046    
00047 
00048 #endif

Generated on Mon May 21 01:26:34 2012 for Advanced Strategic Command by  doxygen 1.5.1