PIVariant::fromType() methods

This commit is contained in:
2022-11-27 12:40:31 +03:00
parent a786c928e0
commit 6e13ee173e
3 changed files with 28 additions and 5 deletions

View File

@@ -25,7 +25,7 @@ public:
Editable = 0x02,
Label = 0x04,
ArrayReorder = 0x1001,
ArrayDynamic = 0x1002,
ArrayResize = 0x1002,
};
bool isNull() const {return _is_null;}
@@ -175,11 +175,11 @@ int main(int argc, char * argv[]) {
//for (auto it: root.children()) {
// piCout << it.name() << it.value();
//}
PIVariant v = PIVariant::fromValue(SomeType{1, 0.5f});
PIVariant v = PIVariant::fromType("PIVariantTypes::IODevice");
piCout << v;
piCout << v.toString();
v.setValueFromString("2;-0.1");
piCout << v;
piCout << v.value<PIVariantTypes::IODevice>();
piCout << v.toString();
return 0;