Major API cleanup. Unified formatting & doxygen tags in the public API.
Added factory provider for default log streams. Added default log streams to std::out and std::cerr. Updated VC8 project config, boost workarounds is now working for the viewer. Updated unit test suite. Fixed some minor issues in the postprocessing-framework. BROKEN: DebugDLL build. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@292 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
52
code/StdOStreamLogStream.h
Normal file
52
code/StdOStreamLogStream.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#ifndef AI_STROSTREAMLOGSTREAM_H_INC
|
||||
#define AI_STROSTREAMLOGSTREAM_H_INC
|
||||
|
||||
#include "../include/LogStream.h"
|
||||
#include <ostream>
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
/** @class StdOStreamLogStream
|
||||
* @brief Logs into a std::ostream
|
||||
*/
|
||||
class StdOStreamLogStream : public LogStream
|
||||
{
|
||||
public:
|
||||
/** @brief Construction from an existing std::ostream
|
||||
* @param _ostream Output stream to be used
|
||||
*/
|
||||
StdOStreamLogStream(std::ostream& _ostream);
|
||||
|
||||
/** @brief Destructor */
|
||||
~StdOStreamLogStream();
|
||||
|
||||
/** @brief Writer */
|
||||
void write(const std::string &messgae);
|
||||
private:
|
||||
std::ostream& ostream;
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Default constructor
|
||||
inline StdOStreamLogStream::StdOStreamLogStream(std::ostream& _ostream)
|
||||
: ostream (_ostream)
|
||||
{}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Default constructor
|
||||
inline StdOStreamLogStream::~StdOStreamLogStream()
|
||||
{}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Write method
|
||||
inline void StdOStreamLogStream::write(const std::string &message)
|
||||
{
|
||||
ostream << message.c_str();
|
||||
ostream.flush();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
} // Namespace Assimp
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user