A.I.M.S


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

aims::GenericWriter::GenericWriter ( )
inline

Definition at line 49 of file writer.h.

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

Definition at line 50 of file writer.h.

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

Definition at line 53 of file writer.h.

Member Function Documentation

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().

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

Definition at line 72 of file writer.h.

References _options.

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().

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

Definition at line 73 of file writer.h.

References _options.

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 operator<<().

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

Implemented in aims::Writer< T >.

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

Implemented in aims::Writer< T >.

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

Implemented in aims::Writer< T >.

Member Data Documentation

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

Definition at line 80 of file writer.h.

Referenced by fileName(), and setFileName().

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

Definition at line 81 of file writer.h.

Referenced by options(), and setOptions().


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