aimsdata  5.0.5
Neuroimaging data handling
aims::GenericWriter Class Referenceabstract

#include <aims/io/writer.h>

Inheritance diagram for aims::GenericWriter:
Collaboration diagram for aims::GenericWriter:

Public Member Functions

 GenericWriter ()
 
 GenericWriter (const std::string &filename, carto::Object options=carto::none())
 
virtual ~GenericWriter ()
 
template<typename T >
bool write (const T &obj, bool ascii=false, const std::string *format=0)
 Finds the correct format and writes the object. More...
 
void setFileName (const std::string &fileName)
 set output file name More...
 
const std::string & fileName () const
 get output file name More...
 
const carto::Object options () const
 
void setOptions (carto::Object opt)
 
virtual std::string writtenObjectType () const =0
 
virtual std::string writtenObjectDataType () const =0
 
virtual std::string writtenObjectFullType () const =0
 

Protected Attributes

std::string _filename
 
carto::Object _options
 

Detailed Description

Definition at line 46 of file writer.h.

Constructor & Destructor Documentation

◆ GenericWriter() [1/2]

aims::GenericWriter::GenericWriter ( )
inline

Definition at line 49 of file writer.h.

◆ GenericWriter() [2/2]

aims::GenericWriter::GenericWriter ( const std::string &  filename,
carto::Object  options = carto::none() 
)
inline

Definition at line 50 of file writer.h.

◆ ~GenericWriter()

virtual aims::GenericWriter::~GenericWriter ( )
inlinevirtual

Definition at line 53 of file writer.h.

References write().

Member Function Documentation

◆ fileName()

const std::string& aims::GenericWriter::fileName ( ) const
inline

get output file name

Definition at line 71 of file writer.h.

References _filename.

Referenced by setFileName(), and write().

◆ options()

const carto::Object aims::GenericWriter::options ( ) const
inline

Definition at line 72 of file writer.h.

References _options.

Referenced by aims::Writer< T >::write().

◆ setFileName()

void aims::GenericWriter::setFileName ( const std::string &  fileName)
inline

set output file name

Definition at line 66 of file writer.h.

References _filename, and fileName().

◆ setOptions()

void aims::GenericWriter::setOptions ( carto::Object  opt)
inline

◆ write()

template<typename T >
bool aims::GenericWriter::write ( const T &  obj,
bool  ascii = false,
const std::string *  format = 0 
)

Finds the correct format and writes the object.

If format 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 no extension and no format are given, the first working format will be used.

Definition at line 74 of file writer_d.h.

References fileName(), and aims::Writer< T >::write().

Referenced by aims::operator<<(), ~GenericWriter(), and aims::Writer< T >::~Writer().

◆ writtenObjectDataType()

virtual std::string aims::GenericWriter::writtenObjectDataType ( ) const
pure virtual

Implemented in aims::Writer< T >.

Referenced by setOptions(), and aims::Writer< T >::~Writer().

◆ writtenObjectFullType()

virtual std::string aims::GenericWriter::writtenObjectFullType ( ) const
pure virtual

Implemented in aims::Writer< T >.

Referenced by setOptions(), and aims::Writer< T >::~Writer().

◆ writtenObjectType()

virtual std::string aims::GenericWriter::writtenObjectType ( ) const
pure virtual

Implemented in aims::Writer< T >.

Referenced by setOptions(), and aims::Writer< T >::~Writer().

Member Data Documentation

◆ _filename

std::string aims::GenericWriter::_filename
protected

Definition at line 80 of file writer.h.

Referenced by fileName(), setFileName(), and aims::Writer< T >::write().

◆ _options

carto::Object aims::GenericWriter::_options
protected

Definition at line 81 of file writer.h.

Referenced by options(), setOptions(), and aims::Writer< T >::write().


The documentation for this class was generated from the following files: