| Last change
 on this file since 11942 was             11580, checked in by tbretz, 14 years ago | 
        
          | Added --null option to suppress the output more or less completely. | 
        
          | File size:
            1.3 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 | public: | 
|---|
| 13 | ConsoleStream(const char *name); | 
|---|
| 14 |  | 
|---|
| 15 | void SetNullOutput(bool null) { fLogO.SetNullOutput(null); } | 
|---|
| 16 |  | 
|---|
| 17 | // I/O | 
|---|
| 18 | WindowLog &GetStreamOut() { return fLogO; } | 
|---|
| 19 | WindowLog &GetStreamIn()  { return fLogO; } | 
|---|
| 20 |  | 
|---|
| 21 | const WindowLog &GetStreamOut() const { return fLogO; } | 
|---|
| 22 | const WindowLog &GetStreamIn()  const { return fLogO; } | 
|---|
| 23 |  | 
|---|
| 24 | void Run(const char * = 0); | 
|---|
| 25 | }; | 
|---|
| 26 |  | 
|---|
| 27 |  | 
|---|
| 28 |  | 
|---|
| 29 | class Console : public Readline | 
|---|
| 30 | { | 
|---|
| 31 | private: | 
|---|
| 32 | WindowLog fLogO; | 
|---|
| 33 | WindowLog fLogI; | 
|---|
| 34 |  | 
|---|
| 35 | bool fContinous; | 
|---|
| 36 | public: | 
|---|
| 37 | Console(const char *name); | 
|---|
| 38 | ~Console(); | 
|---|
| 39 |  | 
|---|
| 40 | // Console | 
|---|
| 41 | void SetContinous(bool cont) { fContinous = cont; } | 
|---|
| 42 | bool IsContinous() const { return fContinous; } | 
|---|
| 43 |  | 
|---|
| 44 | // I/O | 
|---|
| 45 | WindowLog &GetStreamOut() { return fLogO; } | 
|---|
| 46 | WindowLog &GetStreamIn()  { return fLogI; } | 
|---|
| 47 |  | 
|---|
| 48 | const WindowLog &GetStreamOut() const { return fLogO; } | 
|---|
| 49 | const WindowLog &GetStreamIn()  const { return fLogI; } | 
|---|
| 50 |  | 
|---|
| 51 | // Readline | 
|---|
| 52 | bool PrintGeneralHelp(); | 
|---|
| 53 | bool PrintCommands(); | 
|---|
| 54 | bool PrintKeyBindings(); | 
|---|
| 55 |  | 
|---|
| 56 | bool Process(const std::string &str); | 
|---|
| 57 |  | 
|---|
| 58 | std::string GetLinePrompt() const; | 
|---|
| 59 |  | 
|---|
| 60 | void Startup(); | 
|---|
| 61 | void EventHook(); | 
|---|
| 62 | void Run(const char * = 0); | 
|---|
| 63 | }; | 
|---|
| 64 |  | 
|---|
| 65 | #endif | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.