soma-io
5.1.2
|
Generic writer for every format of Aims object. More...
#include <soma-io/io/writer.h>
Public Member Functions | |
Writer () | |
Writer (carto::rc_ptr< DataSource > ds) | |
Writer (const std::string &filename) | |
Writer (std::ostream &stream) | |
virtual | ~Writer () |
virtual bool | write (const T &obj, carto::Object options=carto::none(), int passbegin=1, int passend=4) |
Finds the correct format and writes the object. More... | |
virtual std::string | writtenObjectType () const |
bool | write (const carto::Object &obj, carto::Object options, int passbegin, int passend) |
![]() | |
GenericWriter () | |
GenericWriter (carto::rc_ptr< DataSource > ds) | |
GenericWriter (const std::string &filename) | |
GenericWriter (std::ostream &stream) | |
virtual | ~GenericWriter () |
template<typename T > | |
bool | write (const T &obj, carto::Object options=carto::none()) |
Finds the correct format and writes the object. More... | |
const carto::rc_ptr< DataSource > | dataSource () const |
carto::rc_ptr< DataSource > | dataSource () |
void | attach (carto::rc_ptr< DataSource > ds) |
void | attach (const std::string &filename) |
void | attach (std::ostream &stream) |
void | flush () |
flush the writing DataSource (if still open) More... | |
void | close () |
close the writing DataSource More... | |
template<> | |
bool | write (const carto::Object &obj, carto::Object options) |
Additional Inherited Members | |
![]() | |
carto::rc_ptr< DataSourceInfo > | _datasourceinfo |
Generic writer for every format of Aims object.
The Writer classes are built on the same model as the Reader classes and share the same FormatDictionary with them to store all known file formats.
See IO system general explanations on how to use Reader and Writer classes.
soma::Writer< T >::Writer |
Definition at line 73 of file writer_d.h.
soma::Writer< T >::Writer | ( | carto::rc_ptr< DataSource > | ds | ) |
Definition at line 79 of file writer_d.h.
soma::Writer< T >::Writer | ( | const std::string & | filename | ) |
Definition at line 85 of file writer_d.h.
soma::Writer< T >::Writer | ( | std::ostream & | stream | ) |
Definition at line 91 of file writer_d.h.
|
virtual |
Definition at line 97 of file writer_d.h.
|
inline |
Definition at line 137 of file writer.h.
References soma::Writer< T >::write().
|
virtual |
Finds the correct format and writes the object.
Options can be passed to specify some writing parameters. The most important is the format ("format"
property): if it is specified, this format is tried first, so you can use it to force the format, otherwise it will be determined from the filename extension (if available). If no extension and no format are given, the first working format will be used. It is possible to specify which passes to process through passbegin
and passend
.
Definition at line 120 of file writer_d.h.
References carto::FileUtil::extension(), rc_ptr< GenericObject >::get(), carto::io_error::keepExceptionPriority(), carto::io_error::launchExcept(), localMsg, carto::toString(), carto::Object::value(), soma::FormatWriter< T >::write(), soma::FormatDictionary< T >::writeExtensions(), and soma::FormatDictionary< T >::writeFormat().
Referenced by soma::Writer< T >::write(), and soma::GenericWriter::write().
|
virtual |
Implements soma::GenericWriter.
Definition at line 103 of file writer_d.h.
References carto::DataTypeCode< class >::name().