Updated attribute dialog

This commit is contained in:
Borna Rajković committed 2022-05-15 16:13:29 +02:00
1 parent 05fa2abbb0
commit 23764776f1
8 files changed
+151 -23

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@ Enumeration::Enumeration(std::string name, Value value)
: name(name), value(value)
{}
std::string Enumeration::getName() {
std::string& Enumeration::getName() {
return name;
}
Value Enumeration::getValue() {
+1 -1
View File
@@ -15,7 +15,7 @@ class Enumeration {
public:
Enumeration(std::string name, Value value);
std::string getName();
std::string& getName();
Value getValue();
};
+23
View File
@@ -39,6 +39,29 @@ public:
this->type = UNDEFINED;
}
bool equals(Value value) {
if(value.getType() == type) {
switch (type) {
case INT:
return value.asInt() == intValue;
case STRING:
return value.asString() == stringValue;
case NIL:
case UNDEFINED:
return true;
case WIRE_REFERENCE:
case ATTRIBUTE_REFERENCE:
case ADDRESS_SPACE_REFERENCE:
return value.asReference() == reference;
case BOOL:
return value.asBool() == boolValue;
default:
return false;
}
}
return false;
}
std::string string();
ValueType getType();