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

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: