35 YUnknownPropertyType = 0,
45 typedef long long YInteger;
67 std::string
name()
const {
return _name; }
72 YPropertyType
type()
const {
return _type; }
112 _type( YStringProperty ), _stringVal( str ) {}
118 _type( YStringProperty ), _stringVal( str ) {}
124 _type( YBoolProperty ), _boolVal( b ) {}
130 _type( YIntegerProperty ), _integerVal( num ) {}
136 _type( YIntegerProperty ), _integerVal( num ) {}
145 _type( YUnknownPropertyType ) {}
169 YPropertyType
type()
const {
return _type; }
181 bool boolVal()
const {
return _boolVal; }
182 YInteger integerVal()
const {
return _integerVal; }
188 std::string _stringVal;
190 YInteger _integerVal;
211 void check(
const std::string & propertyName )
const;
222 void check(
const std::string & propertyName, YPropertyType type )
const;
237 bool contains(
const std::string & propertyName )
const throw();
252 bool contains(
const std::string & propertyName, YPropertyType type )
const;
263 bool isEmpty()
const {
return _properties.empty(); }
268 int size()
const {
return (
int) _properties.size(); }
283 typedef std::vector<YProperty>::const_iterator const_iterator;
303 std::vector<YProperty> _properties;
A set of properties to check names and types against.
void check(const YProperty &prop) const
Same as above, overloaded for convenience.
void check(const std::string &propertyName) const
Check if a property 'propertyName' exists in this property set.
bool isEmpty() const
Returns 'true' if this property set does not contain anything.
int size() const
Returns the number of properties in this 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.
bool contains(const YProperty &prop) const
Same as above, overloaded for convenience.
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.
YPropertyValue(bool b)
Constructor for bool properties.
YPropertyValue(const std::string &str)
Constructor for string properties.
YPropertyValue()
Default constructor.
std::string stringVal() const
Methods to get the value of this property.
YPropertyValue(int num)
Constructor for numerical (YCP integer) properties.
YPropertyValue(YInteger num)
Constructor for numerical (YCP integer) properties.
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.
YPropertyValue(const char *str)
Constructor for const char * (string) properties.
bool operator!=(const YPropertyValue &other) const
Inequality operator.
Class for widget properties.
std::string name() const
Returns the name of this property.
YProperty(const std::string &name, YPropertyType type, bool isReadOnly=false)
Constructor: Create a property with the specified name and type.
std::string typeAsStr() const
Returns the type of this property as string.
bool isReadOnly() const
Returns 'true' if this property cannot be changed, only retrieved.
YPropertyType type() const
Returns the type of this property.