Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/commandbuffer.cc')
-rw-r--r--src/core/commandbuffer.cc26
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