Last change
on this file since 13948 was 13771, checked in by tbretz, 12 years ago |
Implemented the possibility to print errors form readline; added .gt, .lt and .eq commmands.
|
File size:
1.4 KB
|
Line | |
---|
1 | #ifndef FACT_Console
|
---|
2 | #define FACT_Console
|
---|
3 |
|
---|
4 | #include "Readline.h"
|
---|
5 | #include "WindowLog.h"
|
---|
6 |
|
---|
7 | class ConsoleStream : public Readline
|
---|
8 | {
|
---|
9 | private:
|
---|
10 | WindowLog fLogO;
|
---|
11 |
|
---|
12 | void PrintReadlineError(const std::string &str);
|
---|
13 |
|
---|
14 | public:
|
---|
15 | ConsoleStream(const char *name);
|
---|
16 |
|
---|
17 | void SetNullOutput(bool null) { fLogO.SetNullOutput(null); }
|
---|
18 |
|
---|
19 | // I/O
|
---|
20 | WindowLog &GetStreamOut() { return fLogO; }
|
---|
21 | WindowLog &GetStreamIn() { return fLogO; }
|
---|
22 |
|
---|
23 | const WindowLog &GetStreamOut() const { return fLogO; }
|
---|
24 | const WindowLog &GetStreamIn() const { return fLogO; }
|
---|
25 |
|
---|
26 | void Run(const char * = 0);
|
---|
27 | };
|
---|
28 |
|
---|
29 |
|
---|
30 |
|
---|
31 | class Console : public Readline
|
---|
32 | {
|
---|
33 | private:
|
---|
34 | WindowLog fLogO;
|
---|
35 | WindowLog fLogI;
|
---|
36 |
|
---|
37 | bool fContinous;
|
---|
38 |
|
---|
39 | void PrintReadlineError(const std::string &str);
|
---|
40 |
|
---|
41 | public:
|
---|
42 | Console(const char *name);
|
---|
43 | ~Console();
|
---|
44 |
|
---|
45 | // Console
|
---|
46 | void SetContinous(bool cont) { fContinous = cont; }
|
---|
47 | bool IsContinous() const { return fContinous; }
|
---|
48 |
|
---|
49 | // I/O
|
---|
50 | WindowLog &GetStreamOut() { return fLogO; }
|
---|
51 | WindowLog &GetStreamIn() { return fLogI; }
|
---|
52 |
|
---|
53 | const WindowLog &GetStreamOut() const { return fLogO; }
|
---|
54 | const WindowLog &GetStreamIn() const { return fLogI; }
|
---|
55 |
|
---|
56 | // Readline
|
---|
57 | bool PrintGeneralHelp();
|
---|
58 | bool PrintCommands();
|
---|
59 | bool PrintKeyBindings();
|
---|
60 |
|
---|
61 | bool Process(const std::string &str);
|
---|
62 |
|
---|
63 | std::string GetLinePrompt() const;
|
---|
64 |
|
---|
65 | void Startup();
|
---|
66 | void EventHook();
|
---|
67 | void Run(const char * = 0);
|
---|
68 | };
|
---|
69 |
|
---|
70 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.