Changeset 1634 for code/branches/gcc43/src/core/OutputHandler.h
- Timestamp:
- Jun 29, 2008, 7:36:33 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gcc43/src/core/OutputHandler.h
r1505 r1634 63 63 64 64 /** @brief Puts some text on the outstream. @param text The text */ 65 static inlinestd::string log(const std::string& text)65 static std::string log(const std::string& text) 66 66 { OutputHandler::getOutStream().setOutputLevel(0); OutputHandler::getOutStream().output(text + "\n"); return text; } 67 67 68 68 /** @brief Puts an error on the outstream. @param text The text */ 69 static inlinestd::string error(const std::string& text)69 static std::string error(const std::string& text) 70 70 { OutputHandler::getOutStream().setOutputLevel(1); OutputHandler::getOutStream().output(text + "\n"); return text; } 71 71 72 72 /** @brief Puts a warning on the outstream. @param text The text */ 73 static inlinestd::string warning(const std::string& text)73 static std::string warning(const std::string& text) 74 74 { OutputHandler::getOutStream().setOutputLevel(2); OutputHandler::getOutStream().output(text + "\n"); return text; } 75 75 76 76 /** @brief Puts an info on the outstream. @param text The text */ 77 static inlinestd::string info(const std::string& text)77 static std::string info(const std::string& text) 78 78 { OutputHandler::getOutStream().setOutputLevel(3); OutputHandler::getOutStream().output(text + "\n"); return text; } 79 79 80 80 /** @brief Puts some debug output on the outstream. @param text The text */ 81 static inlinestd::string debug(const std::string& text)81 static std::string debug(const std::string& text) 82 82 { OutputHandler::getOutStream().setOutputLevel(4); OutputHandler::getOutStream().output(text + "\n"); return text; } 83 83 84 84 /** @brief Returns a reference to the logfile. @return The logfile */ 85 inlinestd::ofstream& getLogfile()85 std::ofstream& getLogfile() 86 86 { return this->logfile_; } 87 87 88 88 /** @brief Sets the level of the incoming output. @param level The level of the incoming output @return The OutputHandler itself */ 89 inlineOutputHandler& setOutputLevel(int level)89 OutputHandler& setOutputLevel(int level) 90 90 { this->outputLevel_ = level; return *this; } 91 91 92 92 /** @brief Returns the level of the incoming output. @return The level */ 93 in line int getOutputLevel() const93 int getOutputLevel() const 94 94 { return this->outputLevel_; } 95 95 … … 102 102 103 103 /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */ 104 inlineOutputHandler& operator<<(unsigned char val) { return this->output(val); }104 OutputHandler& operator<<(unsigned char val) { return this->output(val); } 105 105 /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */ 106 inlineOutputHandler& operator<<(short val) { return this->output(val); }106 OutputHandler& operator<<(short val) { return this->output(val); } 107 107 /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */ 108 inlineOutputHandler& operator<<(unsigned short val) { return this->output(val); }108 OutputHandler& operator<<(unsigned short val) { return this->output(val); } 109 109 /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */ 110 inlineOutputHandler& operator<<(int val) { return this->output(val); }110 OutputHandler& operator<<(int val) { return this->output(val); } 111 111 /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */ 112 inlineOutputHandler& operator<<(unsigned int val) { return this->output(val); }112 OutputHandler& operator<<(unsigned int val) { return this->output(val); } 113 113 /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */ 114 inlineOutputHandler& operator<<(long val) { return this->output(val); }114 OutputHandler& operator<<(long val) { return this->output(val); } 115 115 /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */ 116 inlineOutputHandler& operator<<(unsigned long val) { return this->output(val); }116 OutputHandler& operator<<(unsigned long val) { return this->output(val); } 117 117 /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */ 118 inlineOutputHandler& operator<<(float val) { return this->output(val); }118 OutputHandler& operator<<(float val) { return this->output(val); } 119 119 /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */ 120 inlineOutputHandler& operator<<(double val) { return this->output(val); }120 OutputHandler& operator<<(double val) { return this->output(val); } 121 121 /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */ 122 inlineOutputHandler& operator<<(long double val) { return this->output(val); }122 OutputHandler& operator<<(long double val) { return this->output(val); } 123 123 /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */ 124 inlineOutputHandler& operator<<(const void* val) { return this->output(val); }124 OutputHandler& operator<<(const void* val) { return this->output(val); } 125 125 /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */ 126 inlineOutputHandler& operator<<(bool val) { return this->output(val); }126 OutputHandler& operator<<(bool val) { return this->output(val); } 127 127 128 128 OutputHandler& operator<<(std::streambuf* sb);
Note: See TracChangeset
for help on using the changeset viewer.