libyui
|
#include <YProperty.h>
Public Types | |
typedef std::vector< YProperty > ::const_iterator | const_iterator |
Public Member Functions | |
YPropertySet () | |
void | check (const string &propertyName) const |
void | check (const string &propertyName, YPropertyType type) const |
void | check (const YProperty &prop) const |
bool | contains (const string &propertyName) const throw () |
bool | contains (const string &propertyName, YPropertyType type) const |
bool | contains (const YProperty &prop) const |
bool | isEmpty () const |
int | size () const |
void | add (const YProperty &prop) |
void | add (const YPropertySet &otherSet) |
const_iterator | propertiesBegin () const |
const_iterator | propertiesEnd () const |
A set of properties to check names and types against.
YPropertySet::YPropertySet | ( | ) |
Constructor.
void YPropertySet::add | ( | const YProperty & | prop | ) |
Add a property to this property set.
void YPropertySet::add | ( | const YPropertySet & | otherSet | ) |
Adds all properties of another property set.
If that other set contains duplicates (properties that are already in this set), those others will never be found with lookup().
void YPropertySet::check | ( | const string & | propertyName, |
YPropertyType | type | ||
) | const |
Check if a property 'propertyName' exists in this property set. Throw a YUIUnknownPropertyException if it does not exist.
If there is a property with that name, check also the expected type against 'type'. If the types don't match, throw a YUIPropertyTypeMismatchException. If the property is read-only, throw a YUISetReadOnlyPropertyException.
void YPropertySet::check | ( | const string & | propertyName | ) | const |
Check if a property 'propertyName' exists in this property set. Throw a YUIUnknownPropertyException if it does not exist. Use YPropertySet::contains() for a check that simply returns 'false' if it does not exist.
void YPropertySet::check | ( | const YProperty & | prop | ) | const [inline] |
Same as above, overloaded for convenience.
bool YPropertySet::contains | ( | const string & | propertyName | ) | const throw () |
Check if a property 'propertyName' exists in this property set. Returns 'true' if it exists, 'false' if not.
Use YPropertySet::check() for a check that throws exceptions if there is no such property.
bool YPropertySet::contains | ( | const string & | propertyName, |
YPropertyType | type | ||
) | const |
Check if a property 'propertyName' exists in this property set. Returns 'true' if it exists, 'false' if not.
If there is a property with that name, check also the expected type against 'type'. If the types don't match, throw a YUIPropertyTypeMismatchException.
If the property is read-only, throw a YUISetReadOnlyPropertyException.
Use YPropertySet::check() for a check that throws exceptions if there is no such property.
bool YPropertySet::contains | ( | const YProperty & | prop | ) | const [inline] |
Same as above, overloaded for convenience.
bool YPropertySet::isEmpty | ( | ) | const [inline] |
Returns 'true' if this property set does not contain anything.
YPropertySet::const_iterator YPropertySet::propertiesBegin | ( | ) | const |
Returns an iterator that points to the first property in this set.
YPropertySet::const_iterator YPropertySet::propertiesEnd | ( | ) | const |
Returns an iterator that points after the last property in this set.
int YPropertySet::size | ( | ) | const [inline] |
Returns the number of properties in this set.