C++: setTypes method to Obj
authorjani <jani@asema.com>
Tue, 25 Jun 2019 22:42:33 +0000 (01:42 +0300)
committerjani <jani@asema.com>
Tue, 25 Jun 2019 22:42:33 +0000 (01:42 +0300)
Common/C++/SmartAPI/smartapi/model/Obj.cpp
Common/C++/SmartAPI/smartapi/model/Obj.h

index d45a1854a1bd0c2d344185a85fde286ec42b4ca5..95803d710c1c34849a083960b0a6f24b7e24da1d 100755 (executable)
@@ -197,6 +197,15 @@ void Obj::addType(QString type)
                mTypes.append(typeStr);
 }
 
+void Obj::setTypes(QList<QString> types)
+{
+       clearTypes();
+       while (types.length() > 0) {
+               QString typeStr = Tools::toAbsoluteUri(types.takeFirst());
+               mTypes.append(typeStr);
+       }
+}
+
 bool Obj::hasType(QString type)
 {
        QString typeStr = Tools::toAbsoluteUri(type);
index 561e24f0188d6061a281042dd794a77c95663272..d3979de865fe537cdc9a51c8881558d122542b11 100644 (file)
@@ -114,6 +114,7 @@ public:
        bool removeType(QString type);
        void clearTypes()                                                                                       { mTypes.clear(); }
        void setType(QString type)                                                                      { clearTypes(); addType(type); }
+       void setTypes(QList<QString> types);
        void addType(QString type);
        QList<QString> getTypes()                                                                       { return mTypes; }