20 #pragma warning(disable : 4244 4275)
29 OutputDataWriter::OutputDataWriter(
const std::string& file_name) : m_file_name(file_name) {}
34 if (!m_write_strategy)
36 " Error! No read strategy defined");
39 std::ios_base::openmode openmode = std::ios::out;
41 openmode = std::ios::out | std::ios_base::binary;
46 fout.open(m_file_name, openmode);
52 + m_file_name +
"' for writing.");
55 "File is not good, probably it is a directory.");
57 m_write_strategy->writeOutputData(data, ss);
59 boost::iostreams::filtering_streambuf<boost::iostreams::input> input_filtered;
61 input_filtered.push(boost::iostreams::gzip_compressor());
63 input_filtered.push(boost::iostreams::bzip2_compressor());
64 input_filtered.push(ss);
66 boost::iostreams::copy(input_filtered, fout);
73 m_write_strategy.reset(write_strategy);
Defines namespace FileSystemUtils.
Defines class OutputDataWriter.
Defines and implements template class OutputData.
Contains boost streams related headers.
Strategy interface to write OututData in file.
void setStrategy(IOutputDataWriteStrategy *write_strategy)
Sets concrete writing strategy.
void writeOutputData(const OutputData< double > &data)
Writes output data to file.
std::wstring convert_utf8_to_utf16(const std::string &str)
Converts utf8 string represented by std::string to utf16 string represented by std::wstring.