PIValueTree::standardAttributes

This commit is contained in:
2023-01-26 12:31:54 +03:00
parent 73d482ebe2
commit 5d75f1d298
2 changed files with 34 additions and 0 deletions

View File

@@ -165,6 +165,38 @@ PIValueTree & PIValueTree::remove(const PIString & name) {
} }
const PIStringList & PIValueTree::standardAttributes() {
static PIStringList ret = {
// clang-format off
Attribute::hidden ,
Attribute::readOnly ,
Attribute::isLabel ,
Attribute::grouping ,
Attribute::arrayType ,
Attribute::arrayMinCount,
Attribute::arrayMaxCount,
Attribute::arrayReorder ,
Attribute::arrayResize ,
Attribute::minimum ,
Attribute::maximum ,
Attribute::singleStep ,
Attribute::decimals ,
Attribute::prefix ,
Attribute::suffix ,
Attribute::style ,
Attribute::filter ,
Attribute::absolutePath ,
Attribute::onlyExisting ,
Attribute::widgetType ,
Attribute::expression
// clang-format on
};
return ret;
}
PIValueTree & PIValueTree::operator[](const PIString & name) { PIValueTree & PIValueTree::operator[](const PIString & name) {
if (_is_null) return *this; if (_is_null) return *this;
for (auto & c: _children) for (auto & c: _children)

View File

@@ -103,6 +103,8 @@ public:
PIValueTree & operator[](const PIStringList & path); PIValueTree & operator[](const PIStringList & path);
const PIValueTree & operator[](const PIString & name) const { return child(name); } const PIValueTree & operator[](const PIString & name) const { return child(name); }
static const PIStringList & standardAttributes();
private: private:
static void print(PIString & s, const PIValueTree & v, PIString tab); static void print(PIString & s, const PIValueTree & v, PIString tab);
static PIValueTree & nullValue(); static PIValueTree & nullValue();