/* core/commandbuffer.h This file is part of the Osirion project and is distributed under the terms of the GNU General Public License version 2 */ #ifndef __INCLUDED_CORE_COMMANDBUFFER_H__ #define __INCLUDED_CORE_COMMANDBUFFER_H__ #include #include namespace core { class CommandBuffer { public: /// register command buffer functions static void init(); /// remove command buffer functions static void shutdown(); /// execute the commands in the buffer static void exec(); /// clear the command buffer static void clear(); /// execute commands from a file static void exec_file(std::string const & filename); /// print messages from a file static void print_file(std::string const & filename); /// global buffer to hold the command stream static std::stringstream cmd; /// input command completion static void complete(std::string &input, size_t &pos); /// the global command buffer static std::stringstream cmdbuf; private: static void exec(std::string const & cmdline); }; /// the global command buffer inline std::stringstream & cmd() { return CommandBuffer::cmdbuf; } } #endif // __INCLUDED_CORE_COMMANDBUFFER_H__