Changeset 11053 for trunk/FACT++/src
- Timestamp:
- 06/17/11 09:56:41 (13 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Console.cc
r10922 r11053 180 180 fLogO.Display(true); 181 181 } 182 183 // ************************************************************************** 184 /** @class ConsoleStream 185 186 @brief This is an extension to the Readline class provding a colored output 187 188 This in an extension to the Readline class. It's purpose is just to have a 189 colored output stream available. It's main idea is that it is used in 190 environments without user interaction as a replacement the Console class. 191 This is interesting to be able to do everything identical as if Console 192 would be used, but Run() does not prompt but just wait until Stop() 193 was called. The advantage is that some functions of Readline can be used 194 like Execute and the history (just for Execute() commands of course) 195 196 */ 197 // ************************************************************************** 198 199 200 // -------------------------------------------------------------------------- 201 // 202 //! Instantiate a console stream. It will create a single WindowLog object 203 //! which is returned as input and output stream. 204 //! 205 //! @param name 206 //! The name of the program passed to the Readline constructor 207 //! 208 ConsoleStream::ConsoleStream(const char *name) : Readline(name) 209 { 210 ReadlineColor::PrintBootMsg(fLogO, GetName()); 211 } 212 213 // -------------------------------------------------------------------------- 214 // 215 //! Just usleep until Stop() was called. 216 // 217 void ConsoleStream::Run(const char *) 218 { 219 while (!IsStopped()) 220 usleep(10000); 221 } -
trunk/FACT++/src/Console.h
r10305 r11053 4 4 #include "Readline.h" 5 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 // I/O 16 WindowLog &GetStreamOut() { return fLogO; } 17 WindowLog &GetStreamIn() { return fLogO; } 18 19 const WindowLog &GetStreamOut() const { return fLogO; } 20 const WindowLog &GetStreamIn() const { return fLogO; } 21 22 void Run(const char * = 0); 23 }; 24 25 6 26 7 27 class Console : public Readline
Note:
See TracChangeset
for help on using the changeset viewer.