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;
224 bool contains(
const std::string & propertyName )
const throw();
239 bool contains(
const std::string & propertyName, YPropertyType type )
const;
250 bool isEmpty()
const {
return _properties.empty(); }
255 int size()
const {
return (
int) _properties.size(); }
270 typedef std::vector<YProperty>::const_iterator const_iterator;
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.
void check(const std::string &propertyName) const
Check if a property 'propertyName' exists in this property set.
~YPropertyValue()
Destructor.
void add(const YProperty &prop)
Add a property to this property set.
A set of properties to check names and types against.
const_iterator propertiesBegin() const
Returns an iterator that points to the first property in this set.
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 contains(const std::string &propertyName) const
Check if a property 'propertyName' exists in this property set.
YPropertySet()
Constructor.
bool isEmpty() const
Returns 'true' if this property set does not contain anything.
Class for widget properties.
const_iterator propertiesEnd() const
Returns an iterator that points after the last property in this set.
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.