From baf30b7b83822b7d6efd0c16761b8e42a1e96101 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Thu, 24 Dec 2015 00:11:06 +0100 Subject: Match namespace and directory structure --- src/utility.h | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 src/utility.h (limited to 'src/utility.h') diff --git a/src/utility.h b/src/utility.h deleted file mode 100644 index 1dc44ed..0000000 --- a/src/utility.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef CHANGE_SRC_UTILITY_H_ -#define CHANGE_SRC_UTILITY_H_ - -#include - -#include - -#include - -namespace utility { - -class Logger { - public: - Logger(const int target_fd): - buffer_(target_fd, std::ios::out), - stream_(&this->buffer) { } - - void append(const std::string& msg) { - this->stream_ << msg << std::endl; - } - - // Forward the contents of a given standard output stream to the log target - // - // While `this->stream_ << stream.rdbuf()` would be more effective it sadly - // does not work with `boost::process::pistream` due to a broken pipe error - // in conjunction with the required `boost::process::capture_stream` context - // flag. - // - void forward(boost::process::pistream& stream) { - this->stream << std::string( - (std::istreambuf_iterator(stream)), - (std::istreambuf_iterator()) - ); - } - - private: - __gnu_cxx::stdio_filebuf buffer_; - std::ostream stream_; - -}; - -} - -#endif // CHANGE_SRC_UTILITY_H_ -- cgit v1.2.3