vrshoot
annotate libs/assimp/StdOStreamLogStream.h @ 3:c179c72369be
rename candy->vr
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 03 Feb 2014 08:52:13 +0200 |
parents | |
children |
rev | line source |
---|---|
nuclear@0 | 1 #ifndef AI_STROSTREAMLOGSTREAM_H_INC |
nuclear@0 | 2 #define AI_STROSTREAMLOGSTREAM_H_INC |
nuclear@0 | 3 |
nuclear@0 | 4 #include "assimp/LogStream.hpp" |
nuclear@0 | 5 #include <ostream> |
nuclear@0 | 6 |
nuclear@0 | 7 namespace Assimp { |
nuclear@0 | 8 |
nuclear@0 | 9 // --------------------------------------------------------------------------- |
nuclear@0 | 10 /** @class StdOStreamLogStream |
nuclear@0 | 11 * @brief Logs into a std::ostream |
nuclear@0 | 12 */ |
nuclear@0 | 13 class StdOStreamLogStream : public LogStream |
nuclear@0 | 14 { |
nuclear@0 | 15 public: |
nuclear@0 | 16 /** @brief Construction from an existing std::ostream |
nuclear@0 | 17 * @param _ostream Output stream to be used |
nuclear@0 | 18 */ |
nuclear@0 | 19 StdOStreamLogStream(std::ostream& _ostream); |
nuclear@0 | 20 |
nuclear@0 | 21 /** @brief Destructor */ |
nuclear@0 | 22 ~StdOStreamLogStream(); |
nuclear@0 | 23 |
nuclear@0 | 24 /** @brief Writer */ |
nuclear@0 | 25 void write(const char* message); |
nuclear@0 | 26 private: |
nuclear@0 | 27 std::ostream& ostream; |
nuclear@0 | 28 }; |
nuclear@0 | 29 |
nuclear@0 | 30 // --------------------------------------------------------------------------- |
nuclear@0 | 31 // Default constructor |
nuclear@0 | 32 inline StdOStreamLogStream::StdOStreamLogStream(std::ostream& _ostream) |
nuclear@0 | 33 : ostream (_ostream) |
nuclear@0 | 34 {} |
nuclear@0 | 35 |
nuclear@0 | 36 // --------------------------------------------------------------------------- |
nuclear@0 | 37 // Default constructor |
nuclear@0 | 38 inline StdOStreamLogStream::~StdOStreamLogStream() |
nuclear@0 | 39 {} |
nuclear@0 | 40 |
nuclear@0 | 41 // --------------------------------------------------------------------------- |
nuclear@0 | 42 // Write method |
nuclear@0 | 43 inline void StdOStreamLogStream::write(const char* message) |
nuclear@0 | 44 { |
nuclear@0 | 45 ostream << message; |
nuclear@0 | 46 ostream.flush(); |
nuclear@0 | 47 } |
nuclear@0 | 48 |
nuclear@0 | 49 // --------------------------------------------------------------------------- |
nuclear@0 | 50 } // Namespace Assimp |
nuclear@0 | 51 |
nuclear@0 | 52 #endif // guard |