Changeset 149 for cafu/trunk/Libs/ConsoleCommands/Console.hpp
- Timestamp:
- 09/03/10 00:25:58 (21 months ago)
- Files:
-
- 1 modified
-
cafu/trunk/Libs/ConsoleCommands/Console.hpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cafu/trunk/Libs/ConsoleCommands/Console.hpp
r136 r149 22 22 */ 23 23 24 /***************/25 /*** Console ***/26 /***************/27 28 24 #ifndef _CF_CONSOLE_HPP_ 29 25 #define _CF_CONSOLE_HPP_ 30 26 31 27 #include <string> 32 33 struct lua_State;34 28 35 29 … … 47 41 48 42 // Methods for console output. 49 // TODO: These methods could also have a signature like (const char* s="", ...) directly, see GuiSys/Gui.hpp for an example!!50 // Much better of course would be to implement operator <<, as with std::cout.51 43 virtual void Print(const std::string& s)=0; ///< Print message to console. 52 44 virtual void DevPrint(const std::string& s)=0; ///< Print dev message to console. 53 45 virtual void Warning(const std::string& s)=0; ///< Print warning to console. 54 46 virtual void DevWarning(const std::string& s)=0; ///< Print dev warning to console. 55 56 57 /// Registers the methods of this interface with LuaState as a Lua module as described in the PiL2 book, chapter 26.2.58 /// The key idea is that all methods are called via the global Console variable defined below,59 /// and therefore we may consider them as a collection of C-style functions (no OO involved),60 /// so that putting them in a Lua table as described in chapter 26 of the PiL2 book is straightforward.61 static void RegisterLua(lua_State* LuaState);62 47 }; 63 48
