bool open() bool open(const char *fname) bool open(const std::string fname)
Create (or overwrite) a file for writing with an output oemolstream
.
The fname
argument specifies the filename of the file to be created.
The open with no argument may be used to specify that the output
oemolstream
should write to standard out (std::cout
).
This method sets the file format property of the output oemolstream
based upon the extension of the given filename. Additionally, if the
filename end with ``.gz'', the file is written in gzip compressed format.
If the file extension isn't recognized, the file format is set to
OEFormat::UNDEFINED
. The filename based file format may be
overridden by calling oemolostream::SetFormat
explicitly with
the desired file format. If the filename is only a file extension
(e.g. ``.oeb.gz''), then std::cout
will be opened with the
format appropriate to the given extension.