diff --git a/src/App/Metadata.cpp b/src/App/Metadata.cpp index 05d58b4516..785413960f 100644 --- a/src/App/Metadata.cpp +++ b/src/App/Metadata.cpp @@ -172,6 +172,11 @@ std::string Metadata::name() const return _name; } +std::string Metadata::type() const +{ + return _type; +} + Meta::Version Metadata::version() const { return _version; @@ -291,6 +296,11 @@ void Metadata::setName(const std::string& name) _name = name; } +void Metadata::setType(const std::string& type) +{ + _type = type; +} + void Metadata::setVersion(const Meta::Version& version) { _version = version; @@ -726,6 +736,7 @@ bool Metadata::supportsCurrentFreeCAD() const void Metadata::appendToElement(DOMElement* root) const { appendSimpleXMLNode(root, "name", _name); + appendSimpleXMLNode(root, "type", _type); appendSimpleXMLNode(root, "description", _description); if (_version != Meta::Version()) { // Only append version if it's not 0.0.0 @@ -864,6 +875,9 @@ void Metadata::parseVersion1(const DOMNode* startNode) if (tagString == "name") { _name = StrXUTF8(element->getTextContent()).str; } + else if (tagString == "type") { + _type = StrXUTF8(element->getTextContent()).str; + } else if (tagString == "version") { _version = Meta::Version(StrXUTF8(element->getTextContent()).str); } diff --git a/src/App/Metadata.h b/src/App/Metadata.h index a3a7ad0910..a741c19b2c 100644 --- a/src/App/Metadata.h +++ b/src/App/Metadata.h @@ -219,6 +219,7 @@ public: ////////////////////////////////////////////////////////////// std::string name() const; //< A short name for this package, often used as a menu entry. + std::string type() const; //< The type for this package. Meta::Version version() const;//< Version string in semantic triplet format, e.g. "1.2.3". std::string date() const;//< Date string -- currently arbitrary (when C++20 is well-supported we can revisit) @@ -285,6 +286,7 @@ public: // Setters void setName(const std::string& name); + void setType(const std::string& type); void setVersion(const Meta::Version& version); void setDate(const std::string& date); void setDescription(const std::string& description); @@ -348,6 +350,7 @@ public: private: std::string _name; + std::string _type; Meta::Version _version; std::string _date; std::string _description;