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 Regexp & value () const
virtual bool runMatchString (const String &str, MatchingParams *params=0) const
virtual MatchingItemBase * copy () const
virtual const MatchingItemRegexp * itemRegexp () const
Public Member Functions inherited from MatchingItemBase
 MatchingItemBase (const char *name, bool negated=false)
const String & name () 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 MatchingItemString * itemString () const
virtual const MatchingItemRandom * itemRandom () const
virtual const MatchingItemList * itemList () const
virtual const MatchingItemCustom * itemCustom () const
virtual String & dump (String &buf, const MatchingItemDump *dump=0, const String &indent=String::empty(), const String &origIndent=String::empty(), unsigned int depth=0) const
virtual String & dumpValue (String &buf, const MatchingItemDump *dump=0, const String &indent=String::empty(), const String &origIndent=String::empty(), unsigned int depth=0) const
virtual GenObject * dumpXml (const MatchingItemDump *dump=0, unsigned int depth=0) const
virtual const String & toString () const
Public Member Functions inherited from GenObject
 GenObject ()
virtual ~GenObject ()
virtual bool alive () const
virtual void destruct ()
virtual const String & traceId () const
virtual void * getObject (const String &name) const
NamedCounter * getObjCounter () const
NamedCounter * setObjCounter (NamedCounter *counter)

Static Public Member Functions

static MatchingItemRegexp * build (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 NamedCounter * getObjCounter (const String &name, bool create=true)
static ObjList & getObjCounters ()

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

References MatchingItemBase::MatchingItemBase(), MatchingItemBase::name(), MatchingItemBase::negated(), and value().

Referenced by build(), copy(), and itemRegexp().

◆ 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

References MatchingItemBase::MatchingItemBase(), MatchingItemBase::name(), MatchingItemBase::negated(), and value().

Member Function Documentation

◆ build()

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

References MatchingItemRegexp(), MatchingItemBase::name(), and MatchingItemBase::negated().

◆ copy()

virtual MatchingItemBase * copy ( ) const
inlinevirtual

◆ itemRegexp()

virtual const MatchingItemRegexp * itemRegexp ( ) const
inlinevirtual

Check if this item is a MatchingItemRegexp one

Returns
MatchingItemRegexp pointer

Reimplemented from MatchingItemBase.

References MatchingItemRegexp().

◆ 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

Referenced by copy(), MatchingItemRegexp(), and MatchingItemRegexp().


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