The Writer class This is an important helper class for the store and retrieval system of persistent objects in FreeCAD. More...
#include <Writer.h>
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< FileEntry > | FileList |
std::vector< std::string > | FileNames |
bool | forceXML |
char | indBuf [256] |
short | indent |
The Writer class This is an important helper class for the store and retrieval system of persistent objects in FreeCAD.
Definition at line 54 of file Writer.h.
Writer::Writer | ( | void | ) |
Definition at line 50 of file Writer.cpp.
References indBuf.
Writer::~Writer | ( | ) | [virtual] |
Definition at line 56 of file Writer.cpp.
std::string Writer::addFile | ( | const char * | Name, | |
const Base::Persistence * | Object | |||
) |
add a write request of a persistent object
Definition at line 101 of file Writer.cpp.
References FileList, Base::Writer::FileEntry::FileName, FileNames, getUniqueFileName(), isForceXML(), and Base::Writer::FileEntry::Object.
Referenced by Gui::Thumbnail::Save(), Part::PropertyFilletEdges::Save(), Part::PropertyPartShape::Save(), App::PropertyColorList::Save(), App::PropertyFloatList::Save(), App::PropertyVectorList::Save(), App::PropertyFileIncluded::Save(), Points::PropertyCurvatureList::Save(), Points::PointKernel::Save(), Mesh::PropertyMeshKernel::Save(), Mesh::PropertyCurvatureList::Save(), Gui::MergeDocuments::Save(), Fem::PropertyFemMesh::Save(), and Gui::Document::Save().
void Writer::decInd | ( | void | ) |
decrease indention by one tab
Definition at line 163 of file Writer.cpp.
References indBuf, and indent.
Referenced by Gui::Document::exportObjects(), App::Document::exportObjects(), Robot::Trajectory::Save(), App::PropertyStringList::Save(), App::PropertyFloatList::Save(), App::PropertyIntegerList::Save(), App::PropertyEnumeration::Save(), App::PropertyLinkSubList::Save(), App::PropertyLinkList::Save(), App::PropertyLinkSub::Save(), Part::PropertyGeometryList::Save(), App::PropertyContainer::Save(), Sketcher::PropertyConstraintList::Save(), App::DynamicProperty::Save(), App::Document::Save(), Gui::Document::SaveDocFile(), and MeshCore::MeshOutput::SaveXML().
const std::vector< std::string > & Writer::getFilenames | ( | ) | const |
std::string Writer::getUniqueFileName | ( | const char * | Name | ) | [protected] |
Definition at line 118 of file Writer.cpp.
References Mesh2Shape::ext, Base::FileInfo::extension(), Base::FileInfo::fileNamePure(), FileNames, draftlibs::fcvec::find(), Base::Tools::getUniqueName(), RobotExample::pos, and Base::FileInfo::setFile().
Referenced by addFile().
void Writer::incInd | ( | void | ) |
increase indention by one tab
Definition at line 154 of file Writer.cpp.
References indBuf, and indent.
Referenced by Gui::Document::exportObjects(), App::Document::exportObjects(), Robot::Trajectory::Save(), App::PropertyStringList::Save(), App::PropertyFloatList::Save(), App::PropertyIntegerList::Save(), App::PropertyEnumeration::Save(), App::PropertyLinkSubList::Save(), App::PropertyLinkList::Save(), App::PropertyLinkSub::Save(), Part::PropertyGeometryList::Save(), App::PropertyContainer::Save(), Sketcher::PropertyConstraintList::Save(), App::DynamicProperty::Save(), App::Document::Save(), Gui::Document::SaveDocFile(), and MeshCore::MeshOutput::SaveXML().
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 | ) |
check on state
Definition at line 96 of file Writer.cpp.
References forceXML.
Referenced by addFile(), Gui::Document::exportObjects(), Gui::Thumbnail::Save(), Part::PropertyFilletEdges::Save(), Part::PropertyPartShape::Save(), App::PropertyColorList::Save(), App::PropertyFloatList::Save(), App::PropertyVectorList::Save(), App::PropertyFileIncluded::Save(), Points::PropertyCurvatureList::Save(), Points::PointKernel::Save(), Mesh::PropertyMeshKernel::Save(), Mesh::PropertyCurvatureList::Save(), Fem::PropertyFemMesh::Save(), Gui::Document::Save(), and Gui::Document::SaveDocFile().
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.
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] |
short Base::Writer::indent [protected] |
std::string Base::Writer::ObjectName |
name for underlying file saves
Definition at line 94 of file Writer.h.
Referenced by Points::PointKernel::Save(), and App::FeaturePythonT< FeatureT >::Save().