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;
228 { check( prop.
name(), prop.
type() ); }
237 bool contains(
const std::string & propertyName )
const throw();
252 bool contains(
const std::string & propertyName, YPropertyType type )
const;
258 {
return contains( prop.
name(), prop.
type() ); }
263 bool isEmpty()
const {
return _properties.empty(); }
268 int size()
const {
return (
int) _properties.size(); }
283 typedef std::vector<YProperty>::const_iterator const_iterator;
288 const_iterator propertiesBegin()
const;
293 const_iterator propertiesEnd()
const;
303 std::vector<YProperty> _properties;
307 #endif // YProperty_h YProperty(const std::string &name, YPropertyType type, bool isReadOnly=false)
Constructor: Create a property with the specified name and type.
bool isEmpty() const
Returns 'true' if this property set does not contain anything.
YPropertyValue()
Default constructor.
YPropertyValue(int num)
Constructor for numerical (YCP integer) properties.
Transport class for the value of simple properties.
YPropertyType type() const
Returns the type of this property.
A set of properties to check names and types against.
std::string typeAsStr() const
Returns the type of this property as string.
int size() const
Returns the number of properties in this set.
std::string name() const
Returns the name of this property.
YPropertyValue(const char *str)
Constructor for const char * (string) properties.
std::string stringVal() const
Methods to get the value of this property.
void check(const YProperty &prop) const
Same as above, overloaded for convenience.
Class for widget properties.
bool isReadOnly() const
Returns 'true' if this property cannot be changed, only retrieved.
std::string typeAsStr() const
Returns the type of this property value as string.
bool contains(const YProperty &prop) const
Same as above, overloaded for convenience.
YPropertyValue(YInteger num)
Constructor for numerical (YCP integer) properties.
YPropertyValue(bool b)
Constructor for bool properties.
YPropertyType type() const
Returns the type of this property value.
YPropertyValue(const std::string &str)
Constructor for string properties.