PIValueTree::applyValues
This commit is contained in:
@@ -105,6 +105,19 @@ void PIValueTree::mergeAttributes(const PIVariantMap & a) {
|
||||
}
|
||||
|
||||
|
||||
void PIValueTree::applyValues(const PIValueTree & root) {
|
||||
if (_is_null) return;
|
||||
for (const auto & c: root._children) {
|
||||
for (auto & i: _children) {
|
||||
if (c.name() == i.name()) {
|
||||
i._value.setValueFromString(c.value().toString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool PIValueTree::contains(const PIString & name) const {
|
||||
if (_is_null) return true;
|
||||
for (const auto & c: _children)
|
||||
|
||||
@@ -88,6 +88,8 @@ public:
|
||||
void setAttribute(const PIString & n, const PIVariant & a);
|
||||
void mergeAttributes(const PIVariantMap & a);
|
||||
|
||||
void applyValues(const PIValueTree & root);
|
||||
|
||||
const PIVector<PIValueTree> & children() const { return _children; }
|
||||
void clearChildren() { _children.clear(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user