[Gcblue-commits] gcb_wx/include/scriptinterface tcScenarioLogger.h,NONE,1.1
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-12-10 21:54:45
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26731/include/scriptinterface Added Files: tcScenarioLogger.h Log Message: --- NEW FILE: tcScenarioLogger.h --- /** ** @file tcScenarioLogger.h */ /* Copyright (C) 2005 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ** ** Python interface to tcPanel for scripting */ #ifndef _TCSCENARIOLOGGER_H_ #define _TCSCENARIOLOGGER_H_ #if _MSC_VER > 1000 #pragma once #endif #include <sstream> #include "tcFile.h" namespace scriptinterface { /** * Class to assist in writing game state to python-compliant scenario file */ class tcScenarioLogger { public: /// add scenario text with correct indent level and trailing '\n' void AddScenarioText(const std::string& s); /// write all scenario info to file void WriteAll(); tcScenarioLogger(const std::string& fileName); ~tcScenarioLogger(); private: tcFile scenario; std::stringstream headerText; std::stringstream scenarioText; void CreateHeaderText(); void InitScenarioText(); }; } #endif // _TCSCENARIOLOGGER_H_ |