Updated attribute dialog
This commit is contained in:
1 parent
05fa2abbb0
commit
23764776f1
8 files changed
+151
-23
No files matched your search
@@ -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() {
|
||||
|
||||
@@ -15,7 +15,7 @@ class Enumeration {
|
||||
public:
|
||||
Enumeration(std::string name, Value value);
|
||||
|
||||
std::string getName();
|
||||
std::string& getName();
|
||||
Value getValue();
|
||||
};
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user