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 ) {}
156 YPropertyType
type()
const {
return _type; }
168 bool boolVal()
const {
return _boolVal; }
169 YInteger integerVal()
const {
return _integerVal; }
175 std::string _stringVal;
177 YInteger _integerVal;
198 void check(
const std::string & propertyName )
const;
209 void check(
const std::string & propertyName, YPropertyType
type )
const;
215 { check( prop.
name(), prop.
type() ); }
224 bool contains(
const std::string & propertyName )
const throw();
239 bool contains(
const std::string & propertyName, YPropertyType type )
const;
245 {
return contains( prop.
name(), prop.
type() ); }
250 bool isEmpty()
const {
return _properties.empty(); }
255 int size()
const {
return (
int) _properties.size(); }
270 typedef std::vector<YProperty>::const_iterator const_iterator;
275 const_iterator propertiesBegin()
const;
280 const_iterator propertiesEnd()
const;
290 std::vector<YProperty> _properties;
294 #endif // YProperty_h 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 value as string.
YPropertyValue()
Default constructor.
YPropertyValue(int num)
Constructor for numerical (YCP integer) properties.
YPropertyType type() const
Returns the type of this property.
Transport class for the value of simple properties.
A set of properties to check names and types against.
std::string stringVal() const
Methods to get the value of this property.
std::string name() const
Returns the name of this property.
int size() const
Returns the number of properties in this set.
bool contains(const YProperty &prop) const
Same as above, overloaded for convenience.
YPropertyValue(const char *str)
Constructor for const char * (string) properties.
bool isEmpty() const
Returns 'true' if this property set does not contain anything.
Class for widget properties.
bool isReadOnly() const
Returns 'true' if this property cannot be changed, only retrieved.
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.
void check(const YProperty &prop) const
Same as above, overloaded for convenience.
std::string typeAsStr() const
Returns the type of this property as string.
YPropertyValue(const std::string &str)
Constructor for string properties.