25 #include "YProperty.h" 26 #include "YUIException.h" 35 case YUnknownPropertyType:
return "<Unknown>";
36 case YOtherProperty:
return "<Other>";
37 case YStringProperty:
return "String";
38 case YBoolProperty:
return "Bool";
39 case YIntegerProperty:
return "Integer";
45 return "<Undefined property type>";
56 if (_type != other.
type())
return false;
61 case YStringProperty:
return _stringVal == other.
stringVal();
62 case YBoolProperty:
return _boolVal == other.boolVal();
63 case YIntegerProperty:
return _integerVal == other.integerVal();
65 case YUnknownPropertyType:
72 __builtin_unreachable();
77 return !(*
this == other);
89 if ( ! contains( propertyName ) )
97 if ( ! contains( propertyName, type ) )
108 for ( YPropertySet::const_iterator it = _properties.begin();
109 it != _properties.end();
112 if ( it->name() == propertyName )
123 for ( YPropertySet::const_iterator it = _properties.begin();
124 it != _properties.end();
127 if ( it->name() == propertyName )
129 if ( it->isReadOnly() )
132 if ( it->type() == type ||
133 it->type() == YOtherProperty )
147 _properties.push_back( prop );
163 YPropertySet::const_iterator
166 return _properties.begin();
169 YPropertySet::const_iterator
172 return _properties.end();
Exception class for attempt to set a read-only property.
Transport class for the value of simple properties.
const_iterator propertiesEnd() const
Returns an iterator that points after the last property in this set.
~YPropertyValue()
Destructor.
bool contains(const std::string &propertyName) const
Check if a property 'propertyName' exists in this property set.
void add(const YProperty &prop)
Add a property to this property set.
YPropertyType type() const
Returns the type of this property.
A set of properties to check names and types against.
bool operator!=(const YPropertyValue &other) const
Inequality operator.
bool operator==(const YPropertyValue &other) const
Equality operator, can compare with another YPropertyValue.
std::string typeAsStr() const
Returns the type of this property as string.
const_iterator propertiesBegin() const
Returns an iterator that points to the first property in this set.
std::string stringVal() const
Methods to get the value of this property.
Exception class for "unknown property name": The application tried to set (or query) a property that ...
YPropertySet()
Constructor.
Class for widget properties.
Exception class for "property type mismatch": The application tried to set a property with a wrong ty...
void check(const std::string &propertyName) const
Check if a property 'propertyName' exists in this property set.
Base class for UI Exceptions.
YPropertyType type() const
Returns the type of this property value.