Base::FileWriter Class Reference

#include <Writer.h>

Public Member Functions

void close ()
 FileWriter (const char *DirName)
void putNextEntry (const char *file)
virtual bool shouldWrite (const std::string &name, const Base::Persistence *Object) const
virtual std::ostream & Stream ()
virtual void writeFiles ()
 process the requested file storing More...
virtual ~FileWriter ()
- Public Member Functions inherited from Base::Writer
int getFileVersion () const
void insertAsciiFile (const char *FileName)
 insert a file as CDATA section in the XML file More...
void insertBinFile (const char *FileName)
 insert a binary file BASE64 coded as CDATA section in the XML file More...
bool isForceXML ()
 check on state More...
void setFileVersion (int)
void setForceXML (bool on)
 switch the writer in XML only mode (no files allowed) More...
 Writer ()
virtual ~Writer ()
std::string addFile (const char *Name, const Base::Persistence *Object)
 add a write request of a persistent object More...
const std::vector< std::string > & getFilenames () const
 get all registered file names More...
void setMode (const std::string &mode)
 Set mode. More...
void setModes (const std::set< std::string > &modes)
 Set modes. More...
bool getMode (const std::string &mode) const
 Get mode. More...
std::set< std::string > getModes () const
 Get modes. More...
void clearMode (const std::string &mode)
 Clear mode. More...
void clearModes ()
 Clear modes. More...
void addError (const std::string &)
bool hasErrors () const
void clearErrors ()
std::vector< std::string > getErrors () const
const char * ind () const
 get the current indentation More...
void incInd ()
 increase indentation by one tab More...
void decInd ()
 decrease indentation by one tab More...

Protected Attributes

std::string DirName
std::ofstream FileStream
- Protected Attributes inherited from Base::Writer
std::vector< FileEntryFileList
std::vector< std::string > FileNames
std::vector< std::string > Errors
std::set< std::string > Modes
short indent
char indBuf [1024]
bool forceXML
int fileVersion

Additional Inherited Members

- Public Attributes inherited from Base::Writer
std::string ObjectName
 name for underlying file saves More...
- Protected Member Functions inherited from Base::Writer
std::string getUniqueFileName (const char *Name)

Detailed Description

The FileWriter class This class writes out the data into files into a given directory name.

See also
Werner Mayer

Constructor & Destructor Documentation

◆ FileWriter()

FileWriter::FileWriter ( const char *  DirName)

◆ ~FileWriter()

FileWriter::~FileWriter ( )

Member Function Documentation

◆ close()

void Base::FileWriter::close ( )

◆ putNextEntry()

void FileWriter::putNextEntry ( const char *  file)

◆ shouldWrite()

bool FileWriter::shouldWrite ( const std::string &  name,
const Base::Persistence Object 
) const

This method can be re-implemented in sub-classes to avoid to write out certain objects. The default implementation always returns true.

Reimplemented in Gui::RecoveryWriter.

Referenced by writeFiles().

◆ Stream()

virtual std::ostream & Base::FileWriter::Stream ( void  )

Implements Base::Writer.

◆ writeFiles()

Member Data Documentation

◆ DirName

std::string Base::FileWriter::DirName

◆ FileStream

std::ofstream Base::FileWriter::FileStream

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