25 #include "YProperty.h"
26 #include "YUIException.h"
36 case YUnknownPropertyType:
return "<Unknown>";
37 case YOtherProperty:
return "<Other>";
38 case YStringProperty:
return "String";
39 case YBoolProperty:
return "Bool";
40 case YIntegerProperty:
return "Integer";
46 return "<Undefined property type>";
57 if (_type != other.
type())
return false;
62 case YStringProperty:
return _stringVal == other.
stringVal();
63 case YBoolProperty:
return _boolVal == other.boolVal();
64 case YIntegerProperty:
return _integerVal == other.integerVal();
66 case YUnknownPropertyType:
73 __builtin_unreachable();
78 return !(*
this == other);
98 if ( !
contains( propertyName, type ) )
109 for ( YPropertySet::const_iterator it = _properties.begin();
110 it != _properties.end();
113 if ( it->name() == propertyName )
124 for ( YPropertySet::const_iterator it = _properties.begin();
125 it != _properties.end();
128 if ( it->name() == propertyName )
130 if ( it->isReadOnly() )
133 if ( it->type() == type ||
134 it->type() == YOtherProperty )
148 _properties.push_back( prop );
164 YPropertySet::const_iterator
167 return _properties.begin();
170 YPropertySet::const_iterator
173 return _properties.end();
A set of properties to check names and types against.
void check(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.
const_iterator propertiesBegin() const
Returns an iterator that points to the first property in this set.
const_iterator propertiesEnd() const
Returns an iterator that points after the last property in this set.
YPropertySet()
Constructor.
bool contains(const std::string &propertyName) const
Check if a property 'propertyName' exists in this property set.
Transport class for the value of simple properties.
std::string typeAsStr() const
Returns the type of this property value as string.
std::string stringVal() const
Methods to get the value of this property.
YPropertyType type() const
Returns the type of this property value.
bool operator==(const YPropertyValue &other) const
Equality operator, can compare with another YPropertyValue.
~YPropertyValue()
Destructor.
bool operator!=(const YPropertyValue &other) const
Inequality operator.
Class for widget properties.
std::string typeAsStr() const
Returns the type of this property as string.
YPropertyType type() const
Returns the type of this property.
Base class for UI Exceptions.
Exception class for "property type mismatch": The application tried to set a property with a wrong ty...
Exception class for attempt to set a read-only property.
Exception class for "unknown property name": The application tried to set (or query) a property that ...