Changeset 9537 for code/branches/testing/src/libraries/util
- Timestamp:
- Mar 4, 2013, 11:23:57 PM (12 years ago)
- Location:
- code/branches/testing/src/libraries/util/output
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/testing/src/libraries/util/output/ConsoleWriter.cc
r9536 r9537 34 34 #include "ConsoleWriter.h" 35 35 36 #include <iostream>37 36 38 37 #include "OutputManager.h" … … 48 47 After creation, the instance is enabled. 49 48 */ 50 ConsoleWriter::ConsoleWriter( ) : BaseWriter("Console")49 ConsoleWriter::ConsoleWriter(std::ostream& outputStream) : BaseWriter("Console"), outputStream_(outputStream) 51 50 { 52 51 #ifdef ORXONOX_RELEASE … … 70 69 void ConsoleWriter::printLine(const std::string& line, OutputLevel) 71 70 { 72 std::cout<< line << std::endl;71 this->outputStream_ << line << std::endl; 73 72 } 74 73 -
code/branches/testing/src/libraries/util/output/ConsoleWriter.h
r9536 r9537 37 37 38 38 #include "util/UtilPrereqs.h" 39 40 #include <ostream> 41 39 42 #include "BaseWriter.h" 40 43 … … 50 53 { 51 54 public: 52 ConsoleWriter( );55 ConsoleWriter(std::ostream& outputStream); 53 56 ConsoleWriter(const ConsoleWriter&); 54 57 virtual ~ConsoleWriter(); … … 57 60 void disable(); 58 61 62 inline const std::ostream& getOutputStream() const 63 { return this->outputStream_; } 64 59 65 protected: 60 66 virtual void printLine(const std::string& line, OutputLevel level); 61 67 62 68 private: 63 bool bEnabled_; ///< If false, the instance will not write output to the console. 69 std::ostream& outputStream_; ///< The ostream to which the console writer writes its output 70 bool bEnabled_; ///< If false, the instance will not write output to the console. 64 71 }; 65 72 } -
code/branches/testing/src/libraries/util/output/OutputManager.cc
r9536 r9537 33 33 34 34 #include "OutputManager.h" 35 36 #include <iostream> 35 37 36 38 #include "MemoryWriter.h" … … 111 113 ConsoleWriter& OutputManager::getConsoleWriter() 112 114 { 113 static ConsoleWriter instance ;115 static ConsoleWriter instance(std::cout); 114 116 return instance; 115 117 }
Note: See TracChangeset
for help on using the changeset viewer.