16 std::cerr <<
"Error reading composition axes from " << _filename
26 outfile.
open(_filename);
28 to_json(composition_axes, json);
Write to a temporary file to ensure a good write, then rename.
void close()
Closes stream, and if not a failed write, removes "file" and renames "file.tmp" to "file".
void open(fs::path name, std::string tmp_ext="tmp")
Opens "file.tmp" for writing, with intended final target "file".
fs::ofstream & ofstream()
Access underlying stream.
void print(std::ostream &stream, unsigned int indent=2, unsigned int prec=12) const
Print json to stream.
T get(Args &&... args) const
Get data from json, using one of several alternatives.
jsonParser & to_json(const ClexDescription &desc, jsonParser &json)
void write_composition_axes(fs::path _filename, CompositionAxes const &composition_axes)
Write CompositionAxes to file.
CompositionAxes read_composition_axes(fs::path _filename)