Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

CascadeFSObject::RegexpSelector Class Reference

Selector object which uses a regular expression test on the object name. More...

#include <cascade/util/CascadeFSObject.h>

Inheritance diagram for CascadeFSObject::RegexpSelector:

CascadeFSObject::Selector List of all members.

Public Member Functions

 RegexpSelector ()
 default constructor
virtual ~RegexpSelector ()
virtual bool Compile (const CascadeString &inExpression, int inCFlags=0)
virtual bool Match (CascadeFSObject &inObject)

Detailed Description

Selector object which uses a regular expression test on the object name.

RegexpSelector does regular expression matching (POSIX Basic Regular Expression syntax) on the name (not the path) of the object. Note that it inherits from the base class the ability to select only files, only directories, or both. Usage: create the object and create a CascadeString to hold the expression. Call Compile, passing REG_ICASE for the flags if case-insensitive matching is desired (being sure to check the return value!). Then, pass the Selector in to GetMatchingChild/%GetMatchingChildren.

Note:
REG_NOSUB is always assumed in this class.


Constructor & Destructor Documentation

CascadeFSObject::RegexpSelector::RegexpSelector  )  [inline]
 

default constructor

virtual CascadeFSObject::RegexpSelector::~RegexpSelector  )  [virtual]
 

destructor

The destructor frees all internal memory allocated by compilation of the regular expression.


Member Function Documentation

virtual bool CascadeFSObject::RegexpSelector::Compile const CascadeString inExpression,
int  inCFlags = 0
[virtual]
 

compiles the regular expression

Supply a regular expression and, optionally REG_ICASE for the inCFlags argument if you desire case-insensitive matching. Be sure to check the return value of this function, because a failure to compile will lead to no matches.

Parameters:
inExpression a CascadeString containing the regular expression
inCFlags bitfield flags compatible with POSIX basic regular expression syntax. Note that REG_NOSUB is always applied, however.

virtual bool CascadeFSObject::RegexpSelector::Match CascadeFSObject inObject  )  [virtual]
 

implementation of the regular expression matching function

Clients should have no need to call this function; it simply implements the required Match function of the abstract base class.

Implements CascadeFSObject::Selector.


The documentation for this class was generated from the following file:
Generated on Sun Jul 24 14:27:19 2005 for Cascade Library by  doxygen 1.4.1