CASM  1.1.0
A Clusters Approach to Statistical Mechanics
FormattedDataFile.hh
Go to the documentation of this file.
1 #ifndef CASM_FormattedDataFile
2 #define CASM_FormattedDataFile
3 
4 #include <boost/filesystem.hpp>
5 #include <iostream>
6 
10 
11 namespace CASM {
12 
14  FormattedDataFileOptions(fs::path _file_path = "", bool _json_output = false,
15  bool _json_arrays = false, bool _compress = false);
16 
17  fs::path file_path; // location to write
18  bool json_output; // if true output as json, else csv
19  bool json_arrays; // if true, and json_output==true, output json as arrays
20  bool compress; // if true, write compressed .gz file
21 };
22 
23 template <typename DataObject>
25  public:
27 
28  FormattedDataFile(fs::path file_path, bool json_output, bool json_arrays,
29  bool compress);
30 
32 
33  void operator()(DataFormatter<DataObject> const &formatter,
34  DataObject const &object);
35 
36  private:
41  std::unique_ptr<std::ostream> m_ostream;
42 };
43 
44 } // namespace CASM
45 
46 #endif
void operator()(DataFormatter< DataObject > const &formatter, DataObject const &object)
FormattedDataFile(FormattedDataFileOptions const &options)
std::unique_ptr< std::ostream > m_ostream
Main CASM namespace.
Definition: APICommand.hh:8
FormattedDataFileOptions(fs::path _file_path="", bool _json_output=false, bool _json_arrays=false, bool _compress=false)