Mercurial > hg > orthanc
view Core/LoggingUtils.h @ 3571:fa982a45062b
Merged in TomasZubiri/orthanc-1/Tomas-Zubiri/replaced-broken-url-with-url-from-waybac-1573762425576 (pull request #11)
Replaced broken url with url from wayback archive
author | Sébastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 15 Nov 2019 07:32:26 +0000 |
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_; }; } }