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

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

#include <io.hpp>

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]

TGD::Exporter::Exporter ( )

Constructor. This must be initialized with initialize().

◆ Exporter() [2/2]

TGD::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()

TGD::Exporter::~Exporter ( )

Destructor.

Member Function Documentation

◆ fileName()

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

Returns the file name.

◆ initialize()

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

Initialize. See the constructor documentation.

◆ writeArray()

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

Writes the array to the file.


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