Container which can hold extensions. More...
#include <ExtensionContainer.h>
Public Types | |
typedef std::map< Base::Type, App::Extension * >::iterator | ExtensionIterator |
Public Member Functions | |
ExtensionIterator | extensionBegin () |
ExtensionContainer () | |
ExtensionIterator | extensionEnd () |
App::Extension * | getExtension (Base::Type, bool derived=true, bool no_except=false) const |
App::Extension * | getExtension (const std::string &name) const |
template<typename ExtensionT > | |
ExtensionT * | getExtensionByType (bool no_except=false, bool derived=true) const |
std::vector< Extension * > | getExtensionsDerivedFrom (Base::Type type) const |
template<typename ExtensionT > | |
std::vector< ExtensionT * > | getExtensionsDerivedFromType () const |
bool | hasExtension (Base::Type, bool derived=true) const |
bool | hasExtension (const std::string &name) const |
bool | hasExtensions () const |
void | registerExtension (Base::Type extension, App::Extension *ext) |
virtual | ~ExtensionContainer () |
Access properties | |
virtual Property * | getPropertyByName (const char *name) const override |
find a property by its name More... | |
virtual const char * | getPropertyName (const Property *prop) const override |
get the name of a property More... | |
virtual void | getPropertyMap (std::map< std::string, Property * > &Map) const override |
get all properties of the class (including properties of the parent) More... | |
virtual void | getPropertyList (std::vector< Property * > &List) const override |
get all properties of the class (including properties of the parent) More... | |
virtual short | getPropertyType (const Property *prop) const override |
get the Type of a Property More... | |
virtual short | getPropertyType (const char *name) const override |
get the Type of a named Property More... | |
virtual const char * | getPropertyGroup (const Property *prop) const override |
get the Group of a Property More... | |
virtual const char * | getPropertyGroup (const char *name) const override |
get the Group of a named Property More... | |
virtual const char * | getPropertyDocumentation (const Property *prop) const override |
get the Group of a Property More... | |
virtual const char * | getPropertyDocumentation (const char *name) const override |
get the Group of a named Property More... | |
virtual void | onChanged (const Property *) override |
get called by the container when a property has changed More... | |
virtual void | Save (Base::Writer &writer) const override |
This method is used to save properties to an XML document. More... | |
virtual void | Restore (Base::XMLReader &reader) override |
This method is used to restore properties from an XML document. More... | |
void | saveExtensions (Base::Writer &writer) const |
void | restoreExtensions (Base::XMLReader &reader) |
Public Member Functions inherited from App::PropertyContainer | |
virtual App::Property * | addDynamicProperty (const char *type, const char *name=0, const char *group=0, const char *doc=0, short attr=0, bool ro=false, bool hidden=false) |
virtual App::Property * | getDynamicPropertyByName (const char *name) const |
DynamicProperty::PropData | getDynamicPropertyData (const Property *prop) const |
virtual std::vector< std::string > | getDynamicPropertyNames () const |
virtual std::string | getFullName () const |
virtual unsigned int | getMemSize (void) const |
This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? More... | |
const char * | getPropertyPrefix () const |
bool | isHidden (const char *name) const |
check if the named property is hidden More... | |
bool | isHidden (const Property *prop) const |
check if the property is hidden More... | |
bool | isReadOnly (const char *name) const |
check if the named property is read-only More... | |
bool | isReadOnly (const Property *prop) const |
check if the property is read-only More... | |
virtual void | onPropertyStatusChanged (const Property &prop, unsigned long oldStatus) |
PropertyContainer () | |
A constructor. More... | |
virtual bool | removeDynamicProperty (const char *name) |
void | setPropertyPrefix (const char *prefix) |
void | setPropertyStatus (unsigned char bit, bool value) |
set the Status bit of all properties at once More... | |
virtual | ~PropertyContainer () |
A destructor. More... | |
Public Member Functions inherited from Base::Persistence | |
void | dumpToStream (std::ostream &stream, int compression) |
virtual Base::Type | getTypeId (void) const |
virtual void | RestoreDocFile (Reader &) |
This method is used to restore large amounts of data from a file In this method you simply stream in your SaveDocFile() saved data. More... | |
void | restoreFromStream (std::istream &stream) |
virtual void | SaveDocFile (Writer &) const |
This method is used to save large amounts of data to a binary file. More... | |
Public Member Functions inherited from Base::BaseClass | |
BaseClass () | |
Construction. More... | |
virtual PyObject * | getPyObject (void) |
This method returns the Python wrapper for a C++ object. More... | |
bool | isDerivedFrom (const Type type) const |
virtual void | setPyObject (PyObject *) |
virtual | ~BaseClass () |
Destruction. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Base::Persistence | |
static void * | create (void) |
static std::string | encodeAttribute (const std::string &) |
Encodes an attribute upon saving. More... | |
static Base::Type | getClassTypeId (void) |
static void | init (void) |
Static Public Member Functions inherited from Base::BaseClass | |
static void * | create (void) |
static Type | getClassTypeId (void) |
static void | init (void) |
Protected Member Functions inherited from App::PropertyContainer | |
virtual const PropertyData & | getPropertyData (void) const |
virtual void | handleChangedPropertyName (Base::XMLReader &reader, const char *TypeName, const char *PropName) |
PropertyContainer::handleChangedPropertyName is called during restore to possibly fix reading of older versions of this property container. More... | |
virtual void | handleChangedPropertyType (Base::XMLReader &reader, const char *TypeName, Property *prop) |
PropertyContainer::handleChangedPropertyType is called during restore to possibly fix reading of older versions of the property container. More... | |
virtual void | onBeforeChange (const Property *) |
get called before the value is changed More... | |
Static Protected Member Functions inherited from App::PropertyContainer | |
static const PropertyData * | getPropertyDataPtr (void) |
Static Protected Member Functions inherited from Base::BaseClass | |
static void | initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr) |
Protected Attributes inherited from App::PropertyContainer | |
DynamicProperty | dynamicProps |
Detailed Description
Container which can hold extensions.
In FreeCAD normally inheritance is a chain, it is not possible to use multiple inheritance. The reason for this is that all objects need to be exposed to python, and it is basically impossible to handle multiple inheritance in the C-API for python extensions. Also using multiple parent classes in python is currently not possible with the default object approach.
The concept of extensions allow to circumvent those problems. Extensions are FreeCAD objects which work like normal objects in the sense that they use properties and class methods to define their functionality. However, they are not exposed as individual usable entities but are used to extend other objects. A extended object gets all the properties and methods of the extension. Therefore it is like c++ multiple inheritance, which is indeed used to achieve this on c++ side, but provides a few important additional functionalities:
- Property persistence is handled, save and restore work out of the box
- The objects python API gets extended too with the extension python API
- Extensions can be added from c++ and python, even from both together
The interoperability with python is highly important, as in FreeCAD all functionality should be as easily accessible from python as from c++. To ensure this, and as already noted, extensions can be added to a object from python. However, this means that it is not clear from the c++ object type if an extension was added or not. If added from c++ it becomes clear in the type due to the use of multiple inheritance. If added from python it is a runtime extension and not visible from type. Hence querying existing extensions of an object and accessing its methods works not by type casting but by the interface provided in ExtensionContainer. The default workflow is to query if an extension exists and then get the extension object. No matter if added from python or c++ this interface works always the same.
To add a extension to an object, it must comply to a single restriction: it must be derived from ExtensionContainer. This is important to allow adding extensions from python and also to access the universal extension API. As DocumentObject itself derives from ExtensionContainer this should be the case automatically in most circumstances.
Note that two small boilerplate changes are needed next to the multiple inheritance when adding extensions from c++.
- It must be ensured that the property and type registration is aware of the extensions by using special macros.
- The extensions need to be initialised in the constructor
Here a working example:
From python adding an extension is easier, it must be simply registered to a document object at object initialisation like done with properties. Note that the special python extension objects need to be added, not the c++ objects. Normally the only difference in name is the additional "Python" at the end of the extension name.
Extensions can provide methods that should be overridden by the extended object for customisation of the extension behaviour. In c++ this is as simple as overriding the provided virtual functions. In python a class method must be provided which has the same name as the method to override. This method must not necessarily be in the object that is extended, it must be in the object which is provided to the "registerExtension" call as second argument. This second argument is used as a proxy and enqueired if the method to override exists in this proxy before calling it.
For information on howto create extension see the documentation of Extension
Member Typedef Documentation
◆ ExtensionIterator
typedef std::map<Base::Type, App::Extension*>::iterator App::ExtensionContainer::ExtensionIterator |
Constructor & Destructor Documentation
◆ ExtensionContainer()
ExtensionContainer::ExtensionContainer | ( | ) |
◆ ~ExtensionContainer()
|
virtual |
Member Function Documentation
◆ extensionBegin()
ExtensionIterator App::ExtensionContainer::extensionBegin | ( | ) |
◆ extensionEnd()
ExtensionIterator App::ExtensionContainer::extensionEnd | ( | ) |
◆ getExtension() [1/2]
Extension * ExtensionContainer::getExtension | ( | Base::Type | t, |
bool | derived = true , |
||
bool | no_except = false |
||
) | const |
Referenced by restoreExtensions().
◆ getExtension() [2/2]
Extension * ExtensionContainer::getExtension | ( | const std::string & | name | ) | const |
◆ getExtensionByType()
ExtensionT* App::ExtensionContainer::getExtensionByType | ( | bool | no_except = false , |
bool | derived = true |
||
) | const |
Referenced by PartGui::TaskDlgAttacher::accept(), App::GroupExtensionPy::addObject(), PartDesignGui::ReferenceSelection::allow(), Gui::TreeWidget::dropEvent(), App::Document::exportGraphviz(), Gui::ViewProviderGroupExtension::extensionCanDropObject(), Gui::ViewProviderGroupExtension::extensionClaimChildren(), Gui::ViewProviderGeoFeatureGroupExtension::extensionClaimChildren(), Gui::ViewProviderGeoFeatureGroupExtension::extensionClaimChildren3D(), Gui::ViewProviderGroupExtension::extensionHide(), PartGui::ViewProviderAttachExtension::extensionMergeOverlayIcons(), Gui::ViewProviderGroupExtension::extensionOnDelete(), Gui::ViewProviderGroupExtension::extensionShow(), PartGui::ViewProviderAttachExtension::extensionUpdateData(), Gui::ViewProviderOriginGroupExtension::extensionUpdateData(), Gui::ViewProviderGeoFeatureGroupExtension::extensionUpdateData(), Gui::LinkInfo::get(), Gui::ViewProviderLink::getLinkExtension(), PartDesignGui::isFeatureMovable(), Attacher::AttachEnginePy::readParametersFromFeature(), Gui::LinkInfo::release(), PartDesignGui::relinkToOrigin(), Gui::ViewProviderOriginGroupExtension::slotChangedObjectApp(), Gui::ViewProviderOriginGroupExtension::slotChangedObjectGui(), PartGui::TaskAttacher::TaskAttacher(), Gui::ViewProviderLink::updateLinks(), Gui::ViewProviderOriginGroupExtension::updateOriginSize(), and Attacher::AttachEnginePy::writeParametersToFeature().
◆ getExtensionsDerivedFrom()
std::vector< Extension * > ExtensionContainer::getExtensionsDerivedFrom | ( | Base::Type | type | ) | const |
◆ getExtensionsDerivedFromType()
std::vector<ExtensionT*> App::ExtensionContainer::getExtensionsDerivedFromType | ( | ) | const |
◆ getPropertyByName()
|
overridevirtual |
find a property by its name
Reimplemented from App::PropertyContainer.
Reimplemented in Gui::ViewProviderLink, and Spreadsheet::Sheet.
References App::PropertyContainer::getPropertyByName().
Referenced by FemGui::TaskDlgFemConstraintFluidBoundary::accept(), App::FunctionExpression::evalAggregate(), TechDraw::DrawViewArch::execute(), Mesh::SegmentByMesh::execute(), Mesh::HarmonizeNormals::execute(), Mesh::FlipNormals::execute(), Mesh::FixNonManifolds::execute(), Mesh::FixDuplicatedFaces::execute(), Mesh::FixDuplicatedPoints::execute(), Mesh::FixDegenerations::execute(), Mesh::FixDeformations::execute(), Mesh::FixIndices::execute(), Mesh::FillHoles::execute(), Mesh::RemoveComponents::execute(), App::LinkBaseExtension::extensionExecute(), InspectionGui::ViewProviderInspection::getIcon(), TechDraw::DrawProjGroupItem::getLegacyX(), Gui::ViewProviderLink::getPropertyByName(), App::ObjectIdentifier::getPyValue(), TechDraw::ShapeExtractor::getShapesFromObject(), App::ObjectIdentifier::getValue(), TechDraw::DrawProjGroupItem::getXDirection(), TechDraw::DrawViewPart::getXDirection(), InspectionGui::ViewProviderInspection::inspectDistance(), App::RangeExpression::isTouched(), Gui::ViewProviderAnnotationLabel::onChanged(), App::ObjectIdentifier::resolveProperty(), Part::Primitive::Restore(), Part::Box::Restore(), PartDesign::Fillet::Restore(), PartDesign::Chamfer::Restore(), PartDesign::ProfileBased::Restore(), PartDesign::Transformed::Restore(), TechDraw::DrawTemplatePy::setCustomAttributes(), TechDraw::DrawSVGTemplatePy::setCustomAttributes(), TechDraw::DrawParametricTemplatePy::setCustomAttributes(), App::DocumentObjectPy::setCustomAttributes(), Sketcher::SketchObjectPy::setCustomAttributes(), InspectionGui::ViewProviderInspection::setDistances(), FemGui::TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(), App::DocumentObjectPy::touch(), PartDesignGui::ViewProviderBody::unifyVisualProperty(), InspectionGui::ViewProviderInspection::updateData(), and Points::Module::~Module().
◆ getPropertyDocumentation() [1/2]
|
overridevirtual |
get the Group of a named Property
Reimplemented from App::PropertyContainer.
References App::PropertyContainer::getPropertyDocumentation().
◆ getPropertyDocumentation() [2/2]
|
overridevirtual |
get the Group of a Property
Reimplemented from App::PropertyContainer.
References App::PropertyContainer::getPropertyDocumentation().
◆ getPropertyGroup() [1/2]
|
overridevirtual |
get the Group of a named Property
Reimplemented from App::PropertyContainer.
References App::PropertyContainer::getPropertyGroup().
◆ getPropertyGroup() [2/2]
|
overridevirtual |
get the Group of a Property
Reimplemented from App::PropertyContainer.
References App::PropertyContainer::getPropertyGroup().
◆ getPropertyList()
|
overridevirtual |
get all properties of the class (including properties of the parent)
Reimplemented from App::PropertyContainer.
Reimplemented in Gui::ViewProviderLink.
References App::PropertyContainer::getPropertyList().
Referenced by PartDesignGui::TaskFeaturePick::makeCopy(), Gui::PropertyView::onTimer(), and PartDesignGui::ViewProvider::setBodyMode().
◆ getPropertyMap()
|
overridevirtual |
get all properties of the class (including properties of the parent)
Reimplemented from App::PropertyContainer.
Reimplemented in Gui::ViewProviderLink.
References App::PropertyContainer::getPropertyMap().
Referenced by MeshGui::ViewProviderMesh::getColorProperty(), Gui::ViewProviderLink::getPropertyMap(), Gui::PropertyView::onTimer(), and Gui::ViewProviderDocumentObject::updateView().
◆ getPropertyName()
|
overridevirtual |
get the name of a property
Reimplemented from App::PropertyContainer.
References App::PropertyContainer::getPropertyName().
Referenced by App::TransactionObject::applyChn(), and Spreadsheet::SheetObserver::slotChangedObject().
◆ getPropertyType() [1/2]
|
overridevirtual |
get the Type of a named Property
Reimplemented from App::PropertyContainer.
References App::PropertyContainer::getPropertyType().
◆ getPropertyType() [2/2]
|
overridevirtual |
get the Type of a Property
Reimplemented from App::PropertyContainer.
References App::PropertyContainer::getPropertyType().
Referenced by Part::Box::Restore(), TechDraw::DrawTemplatePy::setCustomAttributes(), TechDraw::DrawSVGTemplatePy::setCustomAttributes(), TechDraw::DrawParametricTemplatePy::setCustomAttributes(), and Sketcher::SketchObjectPy::setCustomAttributes().
◆ hasExtension() [1/2]
bool ExtensionContainer::hasExtension | ( | Base::Type | t, |
bool | derived = true |
||
) | const |
Referenced by App::GroupExtensionPy::addObject(), Gui::ViewProviderDocumentObject::canDelete(), App::Document::exportGraphviz(), App::GeoFeatureGroupExtension::extensionGetSubObject(), PartDesignGui::isFeatureMovable(), Attacher::AttachEnginePy::readParametersFromFeature(), registerExtension(), PartDesignGui::relinkToOrigin(), PartGui::TaskAttacher::TaskAttacher(), Gui::DocumentItem::updateItemSelection(), and Attacher::AttachEnginePy::writeParametersToFeature().
◆ hasExtension() [2/2]
bool ExtensionContainer::hasExtension | ( | const std::string & | name | ) | const |
◆ hasExtensions()
bool ExtensionContainer::hasExtensions | ( | ) | const |
Referenced by saveExtensions().
◆ onChanged()
|
overridevirtual |
get called by the container when a property has changed
Reimplemented from App::PropertyContainer.
Reimplemented in App::DocumentObject, App::MeasureDistance, App::TextDocument, TechDraw::DrawViewPart, Gui::ViewProviderLink, Gui::ViewProviderDocumentObject, TechDraw::DrawViewDimension, PartGui::ViewProviderPartExt, TechDraw::DrawPage, TechDraw::DrawProjGroup, PartDesign::Body, PartDesign::SubShapeBinder, Part::BodyBase, TechDraw::DrawView, TechDraw::DrawLeaderLine, Part::Feature, TechDraw::DrawProjGroupItem, PartDesign::Boolean, PartDesign::FeaturePrimitive, Part::Revolution, PartDesign::Point, PartDesignGui::ViewProviderBoolean, Part::Primitive, Gui::ViewProviderPart, TechDraw::DrawHatch, TechDraw::DrawViewSymbol, TechDraw::DrawViewBalloon, TechDraw::DrawViewSection, PartDesignGui::ViewProvider, TechDrawGui::ViewProviderPage, TechDraw::LandmarkDimension, PartDesignGui::ViewProviderBody, Gui::ViewProviderPlacement, TechDraw::DrawViewDetail, TechDraw::DrawViewMulti, TechDrawGui::ViewProviderDrawingView, TechDraw::DrawGeomHatch, TechDrawGui::ViewProviderGeomHatch, TechDrawGui::ViewProviderHatch, TechDrawGui::ViewProviderTemplate, Gui::ViewProvider, Part::Wedge, Part::Spiral, Part::Helix, SketcherGui::ViewProviderSketch, Fem::FemPostCutFilter, Fem::FemPostWarpVectorFilter, Fem::Constraint, Fem::FemPostScalarClipFilter, MeshGui::ViewProviderMesh, Fem::FemPostDataAtPointFilter, PartDesign::ProfileBased, Fem::FemPostSphereFunction, Fem::FemPostDataAlongLineFilter, FemGui::ViewProviderFemMesh, Part::Sweep, Fem::FemPostPlaneFunction, Fem::ConstraintDisplacement, FemGui::ViewProviderFemPostFunction, Gui::ViewProviderAnnotationLabel, TechDraw::DrawViewClip, Robot::RobotObject, Fem::ConstraintFluidBoundary, Fem::FemPostClipFilter, TechDrawGui::ViewProviderViewPart, TechDraw::DrawViewAnnotation, Fem::FemPostPipeline, TechDraw::DrawTileWeld, TechDraw::DrawViewCollection, Fem::ConstraintPulley, Part::Loft, Robot::TrajectoryDressUpObject, Fem::ConstraintBearing, Fem::ConstraintContact, TechDraw::DrawViewSpreadsheet, Drawing::FeaturePage, Drawing::FeatureViewSymbol, Fem::ConstraintTemperature, TechDraw::DrawSVGTemplate, Drawing::FeatureClip, Fem::ConstraintGear, Fem::ConstraintInitialTemperature, PartDesign::DressUp, Robot::Edge2TracObject, Fem::ConstraintForce, Fem::ConstraintHeatflux, Fem::ConstraintTransform, Path::Feature, TechDraw::DrawViewImage, Robot::TrajectoryObject, TechDrawGui::ViewProviderProjGroup, TechDrawGui::ViewProviderViewSection, Gui::ViewProviderOrigin, Fem::FemMeshObject, TechDraw::DrawTemplate, Gui::ViewProviderMeasureDistance, Fem::ConstraintFixed, Fem::FemPostFunctionProvider, TechDraw::DrawViewDimExtent, TechDraw::DrawRichAnno, PointsGui::ViewProviderPoints, MeshGui::ViewProviderMeshCurvature, Part::Mirroring, Part::Box, Sandbox::SandboxObject, TechDraw::DrawTile, Part::RuledSurface, Fem::ConstraintPlaneRotation, PartDesign::Hole, Fem::ConstraintPressure, Gui::ViewProviderGeometryObject, PathGui::ViewProviderPath, TechDrawGui::ViewProviderImage, FemGui::ViewProviderFemPostFunctionProvider, PartGui::ViewProviderSpline, PartDesign::FeatureBase, FemGui::ViewProviderFemPostObject, PartDesignGui::ViewProviderDatumPoint, PartDesign::Plane, PartDesign::Line, TechDraw::DrawWeldSymbol, PartGui::ViewProviderCustom, PartGui::ViewProviderPartReference, SketcherGui::ViewProviderCustom, InspectionGui::ViewProviderInspection, TechDraw::DrawParametricTemplate, MeshGui::ViewProviderMeshNode, Points::Feature, FemGui::ViewProviderFemConstraint, Mesh::Feature, PartGui::ViewProvider2DObject, Gui::ViewProviderAnnotation, Gui::ViewProviderOriginFeature, MeshGui::ViewProviderMeshDefects, RobotGui::ViewProviderRobotObject, Gui::ViewProviderTextDocument, TechDrawGui::ViewProviderDimension, TechDrawGui::ViewProviderBalloon, TechDrawGui::ViewProviderWeld, TechDrawGui::ViewProviderLeader, TechDrawGui::ViewProviderRichAnno, PartDesign::Chamfer, Sketcher::SketchObject, Part::Ellipse, Part::Line, App::VRMLObject, Part::Vertex, Surface::GeomFillSurface, Part::Circle, and PartDesignGui::ViewProviderDatumCoordinateSystem.
References App::PropertyContainer::onChanged().
Referenced by draftviewproviders.view_base.ViewProviderDraft::attach(), ArchSite.Compass::buildCoordinates(), draftobjects.wire.Wire::execute(), ArchAxis.CommandArchGrid::IsActive(), Gui::ViewProvider::onChanged(), draftviewproviders.view_wpproxy.ViewProviderWorkingPlaneProxy::updateData(), draftviewproviders.view_label.ViewProviderLabel::updateData(), DraftLayer.ViewProviderLayer::updateData(), ArchBuildingPart.ViewProviderBuildingPart::updateData(), ArchPanel.ViewProviderPanelCut::updateData(), and ArchPanel.ViewProviderPanelSheet::updateData().
◆ registerExtension()
void ExtensionContainer::registerExtension | ( | Base::Type | extension, |
App::Extension * | ext | ||
) |
References hasExtension(), and Base::Type::isDerivedFrom().
Referenced by App::Extension::initExtension().
◆ Restore()
|
overridevirtual |
This method is used to restore properties from an XML document.
It uses the XMLReader class, which bases on SAX, to read the in Save() written information. Again the Vector as an example:
Reimplemented from App::PropertyContainer.
Reimplemented in PartDesign::Chamfer, Part::Part2DObject, Part::Primitive, Gui::ViewProvider, PartDesign::Transformed, PartDesign::ProfileBased, PartDesign::Fillet, Part::Box, App::VRMLObject, PartDesign::Hole, PartGui::ViewProvider2DObject, Points::Feature, Sketcher::SketchObject, and Robot::RobotObject.
References App::PropertyContainer::Restore(), and restoreExtensions().
Referenced by App::Document::readObjects(), App::VRMLObject::Restore(), Part::Part2DObject::Restore(), Robot::RobotObject::Restore(), and App::Document::Restore().
◆ restoreExtensions()
void ExtensionContainer::restoreExtensions | ( | Base::XMLReader & | reader | ) |
References Base::Console(), Base::Type::createInstance(), Base::ConsoleSingleton::Error(), Base::Type::fromName(), Base::XMLReader::getAttribute(), Base::XMLReader::getAttributeAsInteger(), getExtension(), Base::XMLReader::hasAttribute(), Base::Type::isBad(), Base::Type::isDerivedFrom(), Base::XMLReader::readElement(), and Base::XMLReader::readEndElement().
Referenced by Restore().
◆ Save()
|
overridevirtual |
This method is used to save properties to an XML document.
A good example you'll find in PropertyStandard.cpp, e.g. the vector:
The writer.ind() expression writes the indentation, just for pretty printing of the XML. As you see, the writing of the XML document is not done with a DOM implementation because of performance reasons. Therefore the programmer has to take care that a valid XML document is written. This means closing tags and writing UTF-8.
- See also
- Base::Writer
Reimplemented from App::PropertyContainer.
Reimplemented in App::DocumentObject, App::VRMLObject, Sketcher::SketchObject, and Robot::RobotObject.
References App::PropertyContainer::Save(), and saveExtensions().
◆ saveExtensions()
void ExtensionContainer::saveExtensions | ( | Base::Writer & | writer | ) | const |
References Base::Console(), Base::Writer::decInd(), Base::ConsoleSingleton::Error(), hasExtensions(), Base::Writer::incInd(), Base::Writer::ind(), and Base::Writer::Stream().
Referenced by Save().
The documentation for this class was generated from the following files:
- src/App/ExtensionContainer.h
- src/App/ExtensionContainer.cpp