1 #ifndef GENESIS_UTILS_IO_FILE_OUTPUT_TARGET_H_
2 #define GENESIS_UTILS_IO_FILE_OUTPUT_TARGET_H_
65 std::string
const& file_name,
66 std::ios_base::openmode mode = std::ios_base::out
68 : file_name_( file_name )
89 std::ostream& out_stream_()
override
92 if( !stream_.is_open() ) {
98 stream_.rdbuf()->pubsetbuf( stream_buffer_, buffer_size_ );
106 std::string target_name_()
const override
108 return "output file (" + file_name_ +
")";
114 std::string target_string_()
const override
124 std::string file_name_;
125 std::ios_base::openmode mode_ = std::ios_base::out;
128 std::ofstream stream_;
129 static const size_t buffer_size_ = 1 << 16;
130 char stream_buffer_[buffer_size_];
137 #endif // include guard