Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/consoleinterface.h')
-rw-r--r--src/sys/consoleinterface.h54
1 files changed, 24 insertions, 30 deletions
diff --git a/src/sys/consoleinterface.h b/src/sys/consoleinterface.h
index 2eae1d8..a7fde2e 100644
--- a/src/sys/consoleinterface.h
+++ b/src/sys/consoleinterface.h
@@ -34,15 +34,14 @@ typedef std::char_traits<char> Traits;
class ConsoleBuffer : public std::basic_streambuf<char, Traits >
{
public:
- const std::string & str() const
- {
+ const std::string & str() const {
return con_buffer;
}
-
+
protected:
/// stream overflow
virtual int overflow(int c = Traits::eof());
-
+
private:
std::string con_buffer;
};
@@ -56,12 +55,11 @@ class ConsoleStream : public std::basic_ostream<char, Traits >
public:
ConsoleStream();
~ConsoleStream();
-
- inline ConsoleBuffer & buf()
- {
+
+ inline ConsoleBuffer & buf() {
return con_buffer;
}
-
+
private:
ConsoleBuffer con_buffer;
};
@@ -79,55 +77,51 @@ class ConsoleInterface
public:
/// default constructor
ConsoleInterface();
-
+
/// default destructor
virtual ~ConsoleInterface();
-
+
/// set maximal number of lines in the log
void set_logsize(const size_t logsize);
-
+
/// return rcon state
- inline bool rcon()
- {
+ inline bool rcon() {
return consoleinterface_rcon;
}
-
+
/// enable or disable rcon
void set_rcon(bool enable = true);
-
+
typedef std::deque<std::string> Queue;
-
- inline Queue & rconbuf()
- {
+
+ inline Queue & rconbuf() {
return consoleinterface_rconbuf;
}
-
- inline Queue & log()
- {
+
+ inline Queue & log() {
return consoleinterface_log;
}
-
+
/// a pointer to the current console instance
static ConsoleInterface *instance();
-
+
/// incoming text event handler
void event_text(const std::string & text);
-
+
/// ncurses resize event
- virtual void resize()
- {};
-
+ virtual void resize() {};
+
protected:
/// print one line of text
virtual void print(const std::string & text);
-
+
private:
/// console singleton
static ConsoleInterface *consoleinterface_instance;
-
+
bool consoleinterface_rcon;
Queue consoleinterface_rconbuf;
-
+
Queue consoleinterface_log;
size_t consoleinterface_logsize;
};