Base::Writer Class Reference

The Writer class This is an important helper class for the store and retrieval system of persistent objects in FreeCAD. More...

#include <Writer.h>

Inheritance diagram for Base::Writer:
Base::StringWriter Base::ZipWriter

List of all members.

Classes

struct  FileEntry

Public Member Functions

void insertAsciiFile (const char *FileName)
 insert a file as CDATA section in the XML file
void insertBinFile (const char *FileName)
 insert a binary file BASE64 coded as CDATA section in the XML file
bool isForceXML (void)
 check on state
void setForceXML (bool on)
 switch the writer in XML only mode (no files allowed)
virtual std::ostream & Stream (void)=0
 Writer (void)
virtual ~Writer ()
additional file writing



std::string addFile (const char *Name, const Base::Persistence *Object)
 add a write request of a persistent object
const std::vector< std::string > & getFilenames () const
 get all registered file names
virtual void writeFiles (void)=0
 process the requested file storing
pretty formating for XML



void decInd (void)
 decrease indention by one tab
void incInd (void)
 increase indention by one tab
const char * ind (void) const
 get the current indention

Public Attributes

std::string ObjectName
 name for underlying file saves

Protected Member Functions

std::string getUniqueFileName (const char *Name)

Protected Attributes

std::vector< FileEntryFileList
std::vector< std::string > FileNames
bool forceXML
char indBuf [256]
short indent

Detailed Description

The Writer class This is an important helper class for the store and retrieval system of persistent objects in FreeCAD.

See also:
Base::Persistence
Author:
Juergen Riegel

Definition at line 54 of file Writer.h.


Constructor & Destructor Documentation

Writer::Writer ( void   ) 

Definition at line 50 of file Writer.cpp.

References indBuf.

Writer::~Writer (  )  [virtual]

Definition at line 56 of file Writer.cpp.


Member Function Documentation

std::string Writer::addFile ( const char *  Name,
const Base::Persistence Object 
)
void Writer::decInd ( void   ) 
const std::vector< std::string > & Writer::getFilenames (  )  const

get all registered file names

Definition at line 149 of file Writer.cpp.

References FileNames.

std::string Writer::getUniqueFileName ( const char *  Name  )  [protected]
void Writer::incInd ( void   ) 
const char* Base::Writer::ind ( void   )  const [inline]

get the current indention

Definition at line 84 of file Writer.h.

Referenced by Gui::Document::exportObjects(), App::Document::exportObjects(), Robot::Waypoint::Save(), Robot::Trajectory::Save(), Robot::Robot6Axis::Save(), Part::PropertyFilletEdges::Save(), Part::PropertyPartShape::Save(), App::PropertyMaterial::Save(), App::PropertyColorList::Save(), App::PropertyColor::Save(), App::PropertyBool::Save(), App::PropertyStringList::Save(), App::PropertyString::Save(), App::PropertyFloatList::Save(), App::PropertyFloat::Save(), App::PropertyIntegerList::Save(), App::PropertyEnumeration::Save(), App::PropertyPath::Save(), App::PropertyInteger::Save(), App::PropertyPythonObject::Save(), App::PropertyLinkSubList::Save(), App::PropertyLinkList::Save(), App::PropertyLinkSub::Save(), App::PropertyLink::Save(), Part::PropertyGeometryList::Save(), App::PropertyPlacement::Save(), App::PropertyMatrix::Save(), App::PropertyVectorList::Save(), App::PropertyVector::Save(), App::PropertyFileIncluded::Save(), App::PropertyContainer::Save(), Sketcher::PropertyConstraintList::Save(), Points::PropertyCurvatureList::Save(), Points::PointKernel::Save(), Mesh::PropertyMeshKernel::Save(), Mesh::PropertyCurvatureList::Save(), Part::GeomLineSegment::Save(), Part::GeomLine::Save(), Part::GeomArcOfCircle::Save(), Part::GeomCircle::Save(), Part::GeomPoint::Save(), Part::Geometry::Save(), Fem::PropertyFemMesh::Save(), App::DynamicProperty::Save(), App::Document::Save(), Sketcher::Constraint::Save(), Gui::Document::SaveDocFile(), and MeshCore::MeshOutput::SaveXML().

void Writer::insertAsciiFile ( const char *  FileName  ) 

insert a file as CDATA section in the XML file

Definition at line 60 of file Writer.cpp.

References Stream().

void Writer::insertBinFile ( const char *  FileName  ) 

insert a binary file BASE64 coded as CDATA section in the XML file

Definition at line 71 of file Writer.cpp.

References Base::base64_encode(), and Stream().

Referenced by App::PropertyFileIncluded::Save().

bool Writer::isForceXML ( void   ) 
void Writer::setForceXML ( bool  on  ) 

switch the writer in XML only mode (no files allowed)

Definition at line 91 of file Writer.cpp.

References forceXML.

Referenced by Gui::Document::exportObjects(), Base::PersistencePy::getContent(), and Gui::Document::SaveDocFile().

virtual std::ostream& Base::Writer::Stream ( void   )  [pure virtual]

Implemented in Base::ZipWriter, and Base::StringWriter.

Referenced by Gui::Document::exportObjects(), insertAsciiFile(), insertBinFile(), Robot::Waypoint::Save(), Robot::Trajectory::Save(), Robot::Robot6Axis::Save(), Part::PropertyFilletEdges::Save(), Part::PropertyPartShape::Save(), App::PropertyMaterial::Save(), App::PropertyColorList::Save(), App::PropertyColor::Save(), App::PropertyBool::Save(), App::PropertyStringList::Save(), App::PropertyString::Save(), App::PropertyFloatList::Save(), App::PropertyFloat::Save(), App::PropertyIntegerList::Save(), App::PropertyEnumeration::Save(), App::PropertyPath::Save(), App::PropertyInteger::Save(), App::PropertyPythonObject::Save(), App::PropertyLinkSubList::Save(), App::PropertyLinkList::Save(), App::PropertyLinkSub::Save(), App::PropertyLink::Save(), Part::PropertyGeometryList::Save(), App::PropertyPlacement::Save(), App::PropertyMatrix::Save(), App::PropertyVectorList::Save(), App::PropertyVector::Save(), App::PropertyFileIncluded::Save(), App::PropertyContainer::Save(), Sketcher::PropertyConstraintList::Save(), Points::PropertyCurvatureList::Save(), Points::PointKernel::Save(), Mesh::PropertyMeshKernel::Save(), Mesh::PropertyCurvatureList::Save(), Part::GeomLineSegment::Save(), Part::GeomLine::Save(), Part::GeomArcOfCircle::Save(), Part::GeomCircle::Save(), Part::GeomPoint::Save(), Part::Geometry::Save(), Fem::PropertyFemMesh::Save(), App::DynamicProperty::Save(), App::Document::Save(), Sketcher::Constraint::Save(), Gui::Thumbnail::SaveDocFile(), Part::PropertyFilletEdges::SaveDocFile(), Part::PropertyPartShape::SaveDocFile(), App::PropertyColorList::SaveDocFile(), App::PropertyFloatList::SaveDocFile(), App::PropertyPythonObject::SaveDocFile(), App::PropertyVectorList::SaveDocFile(), App::PropertyFileIncluded::SaveDocFile(), Points::PropertyCurvatureList::SaveDocFile(), Points::PointKernel::SaveDocFile(), Mesh::PropertyMeshKernel::SaveDocFile(), Mesh::PropertyCurvatureList::SaveDocFile(), Mesh::MeshObject::SaveDocFile(), Fem::FemMesh::SaveDocFile(), Gui::Document::SaveDocFile(), and MeshCore::MeshOutput::SaveXML().

virtual void Base::Writer::writeFiles ( void   )  [pure virtual]

process the requested file storing

Implemented in Base::ZipWriter, and Base::StringWriter.


Member Data Documentation

std::vector<FileEntry> Base::Writer::FileList [protected]

Definition at line 102 of file Writer.h.

Referenced by addFile(), and Base::ZipWriter::writeFiles().

std::vector<std::string> Base::Writer::FileNames [protected]

Definition at line 103 of file Writer.h.

Referenced by addFile(), getFilenames(), and getUniqueFileName().

bool Base::Writer::forceXML [protected]

Definition at line 108 of file Writer.h.

Referenced by isForceXML(), and setForceXML().

char Base::Writer::indBuf[256] [protected]

Definition at line 106 of file Writer.h.

Referenced by decInd(), incInd(), and Writer().

short Base::Writer::indent [protected]

Definition at line 105 of file Writer.h.

Referenced by decInd(), and incInd().

name for underlying file saves

Definition at line 94 of file Writer.h.

Referenced by Points::PointKernel::Save(), and App::FeaturePythonT< FeatureT >::Save().


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

Generated on Wed Nov 23 19:01:48 2011 for FreeCAD by  doxygen 1.6.1