libyui
Loading...
Searching...
No Matches
YPropertySet Class Reference

#include <YProperty.h>

Public Types

typedef std::vector< YProperty >::const_iterator const_iterator
 

Public Member Functions

 YPropertySet ()
 
void check (const std::string &propertyName) const
 
void check (const std::string &propertyName, YPropertyType type) const
 
void check (const YProperty &prop) const
 
bool contains (const std::string &propertyName) const throw ()
 
bool contains (const std::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
 

Detailed Description

A set of properties to check names and types against.

Constructor & Destructor Documentation

◆ YPropertySet()

YPropertySet::YPropertySet ( )

Constructor.

Member Function Documentation

◆ add() [1/2]

void YPropertySet::add ( const YProperty prop)

Add a property to this property set.

◆ add() [2/2]

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().

◆ check() [1/3]

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.

◆ check() [2/3]

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.

◆ check() [3/3]

void YPropertySet::check ( const YProperty prop) const
inline

Same as above, overloaded for convenience.

◆ contains() [1/3]

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.

◆ contains() [2/3]

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.

◆ contains() [3/3]

bool YPropertySet::contains ( const YProperty prop) const
inline

Same as above, overloaded for convenience.

◆ isEmpty()

bool YPropertySet::isEmpty ( ) const
inline

Returns 'true' if this property set does not contain anything.

◆ propertiesBegin()

YPropertySet::const_iterator YPropertySet::propertiesBegin ( ) const

Returns an iterator that points to the first property in this set.

◆ propertiesEnd()

YPropertySet::const_iterator YPropertySet::propertiesEnd ( ) const

Returns an iterator that points after the last property in this set.

◆ size()

int YPropertySet::size ( ) const
inline

Returns the number of properties in this set.


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