libtad  2.1
A library that makes working with multidimensional arrays in C++ easy
Public Member Functions | List of all members
TAD::Exporter Class Reference

The exporter class exports arrays to files or streams. More...

Public Member Functions

 Exporter ()
 Constructor. This must be initialized with initialize(). More...
 
 Exporter (const std::string &fileName, bool append=Overwrite, const TagList &hints=TagList())
 Constructor. The file name is required. The special file name "-" is interpreted as standard output. If the append flag is set, new arrays will be appended to the file (if the file format supports it) instead of overwriting the old file contents. The optional hints may include parameters for the file format, e.g. about compression level. More...
 
 ~Exporter ()
 Destructor. More...
 
void initialize (const std::string &fileName, bool append=Overwrite, const TagList &hints=TagList())
 Initialize. See the constructor documentation. More...
 
std::string fileName () const
 Returns the file name. More...
 
Error writeArray (const ArrayContainer &array)
 Writes the array to the file. More...
 

Detailed Description

The exporter class exports arrays to files or streams.

Constructor & Destructor Documentation

◆ Exporter() [1/2]

TAD::Exporter::Exporter ( )

Constructor. This must be initialized with initialize().

◆ Exporter() [2/2]

TAD::Exporter::Exporter ( const std::string &  fileName,
bool  append = Overwrite,
const TagList hints = TagList() 
)

Constructor. The file name is required. The special file name "-" is interpreted as standard output. If the append flag is set, new arrays will be appended to the file (if the file format supports it) instead of overwriting the old file contents. The optional hints may include parameters for the file format, e.g. about compression level.

Note that this initialization does not try to open the file yet, it merely sets up the necessary information (and thus cannot fail). The functions that access the data will report any errors that might occur.

◆ ~Exporter()

TAD::Exporter::~Exporter ( )

Destructor.

Member Function Documentation

◆ fileName()

std::string TAD::Exporter::fileName ( ) const
inline

Returns the file name.

◆ initialize()

void TAD::Exporter::initialize ( const std::string &  fileName,
bool  append = Overwrite,
const TagList hints = TagList() 
)

Initialize. See the constructor documentation.

◆ writeArray()

Error TAD::Exporter::writeArray ( const ArrayContainer array)

Writes the array to the file.


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