Yate
MatchingItemRegexp Class Reference

A matching item using a regular expression. More...

#include <yateclass.h>

Inheritance diagram for MatchingItemRegexp:
MatchingItemBase GenObject

Public Member Functions

 MatchingItemRegexp (const char *name, const char *value, bool negated=false)
 
 MatchingItemRegexp (const char *name, const Regexp &value, bool negated=false)
 
const Regexpvalue () const
 
virtual bool runMatchString (const String &str, MatchingParams *params=0) const
 
virtual MatchingItemBasecopy () const
 
virtual const MatchingItemRegexpitemRegexp () const
 
- Public Member Functions inherited from MatchingItemBase
 MatchingItemBase (const char *name, bool negated=false)
 
const Stringname () const
 
bool negated () const
 
bool matchString (const String &str, MatchingParams *params=0) const
 
bool matchListParam (const NamedList &list, MatchingParams *params=0) const
 
virtual bool runMatchListParam (const NamedList &list, MatchingParams *params=0) const
 
virtual const MatchingItemStringitemString () const
 
virtual const MatchingItemRandomitemRandom () const
 
virtual const MatchingItemListitemList () const
 
virtual const MatchingItemCustomitemCustom () const
 
virtual Stringdump (String &buf, const MatchingItemDump *dump=0, const String &indent=String::empty(), const String &origIndent=String::empty(), unsigned int depth=0) const
 
virtual StringdumpValue (String &buf, const MatchingItemDump *dump=0, const String &indent=String::empty(), const String &origIndent=String::empty(), unsigned int depth=0) const
 
virtual GenObjectdumpXml (const MatchingItemDump *dump=0, unsigned int depth=0) const
 
virtual const StringtoString () const
 
- Public Member Functions inherited from GenObject
 GenObject ()
 
virtual ~GenObject ()
 
virtual bool alive () const
 
virtual void destruct ()
 
virtual const StringtraceId () const
 
virtual void * getObject (const String &name) const
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 

Static Public Member Functions

static MatchingItemRegexpbuild (const char *name, const String &str, int negated=0, bool insensitive=false, bool extended=false, int fail=1)
 
- Static Public Member Functions inherited from GenObject
static void * getObject (const String &name, const GenObject *obj)
 
static bool getObjCounting ()
 
static void setObjCounting (bool enable)
 
static NamedCountergetObjCounter (const String &name, bool create=true)
 
static ObjListgetObjCounters ()
 

Detailed Description

A matching item using a regular expression.

Match using a regular expression

Constructor & Destructor Documentation

◆ MatchingItemRegexp() [1/2]

MatchingItemRegexp ( const char * name,
const char * value,
bool negated = false )
inline

Constructor

Parameters
nameItem name
valueRegular expression
negatedTrue if matching is negated (return the opposite of match in public methods), false otherwise

◆ MatchingItemRegexp() [2/2]

MatchingItemRegexp ( const char * name,
const Regexp & value,
bool negated = false )
inline

Constructor

Parameters
nameItem name
valueRegular expression
negatedTrue if matching is negated (return the opposite of match in public methods), false otherwise

Member Function Documentation

◆ build()

static MatchingItemRegexp * build ( const char * name,
const String & str,
int negated = 0,
bool insensitive = false,
bool extended = false,
int fail = 1 )
static

Build a MatchingItemRegexp from string

Parameters
nameItem name
strRegexp string
negatedGreater than 0: build a negated match, 0: buid a non negated match, negative: build a negated match if str ends with ^
insensitiveBuild a case insensitive regexp
extendedBuild a regexp using extended POSIX
failpositive: fail if regexp compile fails, negative fail if empty (do not check the regexp) Remember: failed regexp never matches
Returns
MatchingItemRegexp pointer, NULL on failure

◆ copy()

virtual MatchingItemBase * copy ( ) const
inlinevirtual

Copy this item

Returns
MatchingItemBase pointer

Reimplemented from MatchingItemBase.

◆ itemRegexp()

virtual const MatchingItemRegexp * itemRegexp ( ) const
inlinevirtual

Check if this item is a MatchingItemRegexp one

Returns
MatchingItemRegexp pointer

Reimplemented from MatchingItemBase.

◆ runMatchString()

virtual bool runMatchString ( const String & str,
MatchingParams * params = 0 ) const
inlinevirtual

String match

Parameters
strString to match
paramsOptional parameters used during match
Returns
True if matched, false otherwise

Reimplemented from MatchingItemBase.

◆ value()

const Regexp & value ( ) const
inline

Retrieve the regular expression used to match

Returns
Regular expression used to match

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