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;
307 #endif // YProperty_h
YPropertyValue(bool b)
Constructor for bool properties.
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.
bool operator==(const YPropertyValue &other) const
Equality operator, can compare with another YPropertyValue.
~YPropertyValue()
Destructor.
YPropertyType type() const
Returns the type of this property.
YPropertyValue()
Default constructor.
YProperty(const std::string &name, YPropertyType type, bool isReadOnly=false)
Constructor: Create a property with the specified name and type.
int size() const
Returns the number of properties in this set.
YPropertyValue(int num)
Constructor for numerical (YCP integer) properties.
YPropertyValue(const char *str)
Constructor for const char * (string) properties.
std::string typeAsStr() const
Returns the type of this property value as string.
A set of properties to check names and types against.
bool isEmpty() const
Returns 'true' if this property set does not contain anything.
std::string stringVal() const
Methods to get the value of this property.
bool operator!=(const YPropertyValue &other) const
Inequality operator.
const_iterator propertiesEnd() const
Returns an iterator that points after the last property in this set.
YPropertyType type() const
Returns the type of this property value.
Class for widget properties.
std::string typeAsStr() const
Returns the type of this property as string.
YPropertyValue(YInteger num)
Constructor for numerical (YCP integer) properties.
std::string name() const
Returns the name of this property.
const_iterator propertiesBegin() const
Returns an iterator that points to the first property in this set.
void check(const std::string &propertyName) const
Check if a property 'propertyName' exists in this property set.
YPropertyValue(const std::string &str)
Constructor for string properties.
Transport class for the value of simple properties.
bool isReadOnly() const
Returns 'true' if this property cannot be changed, only retrieved.
YPropertySet()
Constructor.
void check(const YProperty &prop) const
Same as above, overloaded for convenience.
bool contains(const YProperty &prop) const
Same as above, overloaded for convenience.