34#ifndef SOMAIO_IO_WRITER_H
35#define SOMAIO_IO_WRITER_H
39#include <cartobase/object/object.h>
72 void attach(
const std::string & filename );
73 void attach( std::ostream & stream );
89 return write( *obj, options );
110 Writer(
const std::string& filename );
111 Writer( std::ostream & stream );
128 virtual bool write(
const T & obj,
130 int passbegin = 1 ,
int passend = 4 );
139 int passbegin,
int passend )
142 return w.
write( *obj, options, passbegin, passend );
150inline soma::GenericWriter &
151operator << ( soma::GenericWriter & writer,
const T & thing )
153 writer.
write( thing );
159inline soma::Writer<T> &
160operator << ( soma::Writer<T> & writer,
const T & thing )
162 writer.
write( thing );
GenericWriter(std::ostream &stream)
GenericWriter(carto::rc_ptr< DataSource > ds)
void close()
close the writing DataSource
void flush()
flush the writing DataSource (if still open)
bool write(const T &obj, carto::Object options=carto::none())
Finds the correct format and writes the object.
const carto::rc_ptr< DataSource > dataSource() const
void attach(std::ostream &stream)
carto::rc_ptr< DataSourceInfo > _datasourceinfo
void attach(const std::string &filename)
GenericWriter(const std::string &filename)
void attach(carto::rc_ptr< DataSource > ds)
carto::rc_ptr< DataSource > dataSource()
virtual std::string writtenObjectType() const =0
Generic writer for every format of Aims object.
virtual std::string writtenObjectType() const
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.
soma::GenericWriter & operator<<(soma::GenericWriter &writer, const T &thing)