libyui
3.4.2
|
A set of properties to check names and types against. More...
#include <YProperty.h>
Public Types | |
typedef std::vector< YProperty >::const_iterator | const_iterator |
Public Member Functions | |
YPropertySet () | |
Constructor. | |
void | check (const std::string &propertyName) const |
Check if a property 'propertyName' exists in this property set. More... | |
void | check (const std::string &propertyName, YPropertyType type) const |
Check if a property 'propertyName' exists in this property set. More... | |
void | check (const YProperty &prop) const |
Same as above, overloaded for convenience. | |
bool | contains (const std::string &propertyName) const throw () |
Check if a property 'propertyName' exists in this property set. More... | |
bool | contains (const std::string &propertyName, YPropertyType type) const |
Check if a property 'propertyName' exists in this property set. More... | |
bool | contains (const YProperty &prop) const |
Same as above, overloaded for convenience. | |
bool | isEmpty () const |
Returns 'true' if this property set does not contain anything. | |
int | size () const |
Returns the number of properties in this set. | |
void | add (const YProperty &prop) |
Add a property to this property set. | |
void | add (const YPropertySet &otherSet) |
Adds all properties of another property set. More... | |
const_iterator | propertiesBegin () const |
Returns an iterator that points to the first property in this set. | |
const_iterator | propertiesEnd () const |
Returns an iterator that points after the last property in this set. | |
A set of properties to check names and types against.
Definition at line 197 of file YProperty.h.
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().
Definition at line 152 of file YProperty.cc.
void YPropertySet::check | ( | const std::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.
Definition at line 87 of file YProperty.cc.
void YPropertySet::check | ( | const std::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.
Definition at line 95 of file YProperty.cc.
bool YPropertySet::contains | ( | const std::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.
Definition at line 106 of file YProperty.cc.
bool YPropertySet::contains | ( | const std::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.
Definition at line 121 of file YProperty.cc.