vrshoot

view libs/assimp/StdOStreamLogStream.h @ 0:b2f14e535253

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