Yate: MatchingItemRegexp Class Reference

Yate

Public Member Functions | Static Public Member Functions | List of all members
MatchingItemRegexp Class Reference

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

`#include <yateclass.h>`

Inheritance diagram for MatchingItemRegexp:

## 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

  name | Item name
  value | Regular expression
  negated | True 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

  name | Item name
  value | Regular expression
  negated | True 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

  name | Item name
  str | Regexp string
  negated | Greater than 0: build a negated match, 0: buid a non negated match, negative: build a negated match if str ends with ^
  insensitive | Build a case insensitive regexp
  extended | Build a regexp using extended POSIX
  fail | positive: 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

Copy this item

Returns
  MatchingItemBase pointer

Reimplemented from MatchingItemBase.

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

## ◆ 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

  str | String to match
  params | Optional 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:

- yateclass.h