Mercurial > hg > orthanc
view Core/LoggingUtils.h @ 3834:219de90c1f43
Added a flag to use an extra buffer in PamReader
to ensure (malloc-like) alignment of the image
buffer. This flag is NOT turned on by default and,
in Orthanc, is only used by the Unit tests.
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 15 Apr 2020 16:58:28 +0200 |
parents | 815b81142ff7 |
children |
line wrap: on
line source
#include <sstream> #include <iostream> namespace Orthanc { namespace Logging { /** std::streambuf subclass used in FunctionCallingStream */ template<typename T> class FuncStreamBuf : public std::stringbuf { public: FuncStreamBuf(T func) : func_(func) {} virtual int sync() { std::string text = this->str(); const char* buf = text.c_str(); func_(buf); this->str(""); return 0; } private: T func_; }; } }