41 #ifndef __STDOUTFILEOSTREAM_HPP__
42 #define __STDOUTFILEOSTREAM_HPP__
46 #include <boost/iostreams/stream.hpp>
47 #include <boost/iostreams/device/null.hpp>
48 #include <boost/filesystem/path.hpp>
49 #include <boost/iostreams/tee.hpp>
50 #include <boost/iostreams/device/file.hpp>
51 #include <boost/iostreams/filtering_stream.hpp>
57 namespace openfluid {
namespace base {
64 typedef boost::iostreams::tee_device<std::ostream,std::ofstream> TeeDevice;
69 typedef boost::iostreams::stream<TeeDevice>
TeeStream;
74 TeeDevice* mp_LoggerDevice;
76 std::ofstream m_FileLogger;
91 inline std::ofstream&
getFile() {
return m_FileLogger; };
93 inline std::ostream&
getStdout() {
return std::cout; };
97 bool open(std::string LogFilePath);
104 inline bool isOpened() {
return m_FileLogger.is_open(); };
105 #elif defined __unix__ || defined __APPLE__
106 inline bool isOpened()
const {
return m_FileLogger.is_open(); };
std::ofstream & getFile()
Definition: StdoutFileOStream.hpp:91
boost::iostreams::stream< TeeDevice > TeeStream
Definition: StdoutFileOStream.hpp:69
std::ostream & getStdout()
Definition: StdoutFileOStream.hpp:93
Definition: StdoutFileOStream.hpp:60
#define DLLEXPORT
Definition: dllexport.hpp:51