libyui  3.1.4
 All Classes Files Functions Variables Typedefs Enumerations Friends Pages
YPropertySet Class Reference

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.
 

Detailed Description

A set of properties to check names and types against.

Definition at line 184 of file YProperty.h.

Member Function Documentation

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 127 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 62 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 70 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 81 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 96 of file YProperty.cc.


The documentation for this class was generated from the following files: