diff options
author | Stijn Buys <ingar@osirion.org> | 2008-02-04 01:17:44 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-02-04 01:17:44 +0000 |
commit | 09fb43f3d36847977ac202c10c5a11f34af03a43 (patch) | |
tree | 45f4537347e9f8b3195cea00356963e9879a08fa /src/core/commandbuffer.cc | |
parent | 840f9b8678f607aecc15d47bc77248c4ac8b8574 (diff) |
astyle
Diffstat (limited to 'src/core/commandbuffer.cc')
-rw-r--r-- | src/core/commandbuffer.cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/core/commandbuffer.cc b/src/core/commandbuffer.cc index fbeba7b..292013b 100644 --- a/src/core/commandbuffer.cc +++ b/src/core/commandbuffer.cc @@ -1,7 +1,7 @@ /* core/commandbuffer.cc - This file is part of the Osirion project and is distributed under - the terms of the GNU General Public License version 2 + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 */ #include "core/commandbuffer.h" @@ -11,18 +11,20 @@ #include <string> #include <sstream> -namespace core { +namespace core +{ std::stringstream cmd(std::stringstream::in | std::stringstream::out); namespace commandbuffer { -void exec(const char *text) { +void exec(const char *text) +{ std::stringstream cmdstream(text); std::string cmdname; cmdstream >> cmdname; - + Func f = func_find(cmdname); if (f) { @@ -33,24 +35,26 @@ void exec(const char *text) { con_print << "unknown command '" << cmdname << "'" << std::endl; } -void execute() { +void execute() +{ if (core::cmd.eof()) return; char line[MAXCMDSIZE]; - while(core::cmd.getline(line, MAXCMDSIZE-1)) { + while (core::cmd.getline(line, MAXCMDSIZE-1)) { exec(line); } cmd.clear(); } -void clear() { +void clear() +{ char line[MAXCMDSIZE]; - while(core::cmd.getline(line, MAXCMDSIZE-1)); + while (core::cmd.getline(line, MAXCMDSIZE-1)); } -} +} // namespace commandbuffer -} +} // namespace core |