| 1 | /*************************************************************************** |
| 2 | CConsole.h - description |
| 3 | ------------------- |
| 4 | begin : December 31th, 2008 |
| 5 | copyright : (C) 2008 by Duong Khang NGUYEN |
| 6 | email : neoneurone @ gmail com |
| 7 | |
| 8 | $Id: CConsole.h 424 2009-11-01 15:59:02Z neoneurone $ |
| 9 | ***************************************************************************/ |
| 10 | |
| 11 | /*************************************************************************** |
| 12 | * * |
| 13 | * This program is free software; you can redistribute it and/or modify * |
| 14 | * it under the terms of the GNU General Public License as published by * |
| 15 | * the Free Software Foundation; either version 2 of the License, or * |
| 16 | * any later version. * |
| 17 | * * |
| 18 | ***************************************************************************/ |
| 19 | |
| 20 | #ifndef _SPF_SYSTEM_CCONSOLE_H_ |
| 21 | #define _SPF_SYSTEM_CCONSOLE_H_ 1 |
| 22 | |
| 23 | // Framework headers |
| 24 | #include "CObject.h" // Object class |
| 25 | |
| 26 | SPF_NAMESPACE_BEGIN(System) |
| 27 | |
| 28 | // Forward System::String class declaration |
| 29 | class String; |
| 30 | |
| 31 | /** |
| 32 | Represents the standard input, output, and error streams for console |
| 33 | applications. By default, the input, output and error streams are connected |
| 34 | to the C++ standard streams. |
| 35 | */ |
| 36 | class Console : public Object |
| 37 | { |
| 38 | public: |
| 39 | Console(); |
| 40 | virtual ~Console(); |
| 41 | |
| 42 | /** |
| 43 | Writes the text representation of the specified object to the standard output stream. |
| 44 | \param value The Object value to write. |
| 45 | \return Nothing. |
| 46 | */ |
| 47 | static void Write(const Object& value); |
| 48 | |
| 49 | /** |
| 50 | Writes the specified string value to the standard output stream. |
| 51 | \param value The String value to write. |
| 52 | \return Nothing. |
| 53 | */ |
| 54 | static void Write(const String& value); |
| 55 | |
| 56 | |
| 57 | virtual String ToString() const; |
| 58 | |
| 59 | /** |
| 60 | Writes the text representation of the specified object to the standard output stream. |
| 61 | \param value The Object value to write. |
| 62 | \return The modified Console reference. |
| 63 | */ |
| 64 | Console& operator<<(const Object& value); |
| 65 | |
| 66 | /** |
| 67 | Writes the character string to the standard output stream. |
| 68 | \param s The character string to write. |
| 69 | \return The modified Console reference. |
| 70 | */ |
| 71 | Console& operator<<(const char* const s); |
| 72 | Console& operator<<(const int i); |
| 73 | }; // class System::Console |
| 74 | |
| 75 | #ifndef _SPF_SYSTEM_CCONSOLE_CPP_ |
| 76 | extern Console Terminal; |
| 77 | #endif |
| 78 | |
| 79 | SPF_NAMESPACE_END |
| 80 | |
| 81 | #endif |