Yate
MatchingItemBase Class Reference

Matching item common interface. More...

#include <yateclass.h>

Inheritance diagram for MatchingItemBase:
GenObject MatchingItemCustom MatchingItemList MatchingItemRandom MatchingItemRegexp MatchingItemString

Public Member Functions

 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 runMatchString (const String &str, MatchingParams *params=0) const
 
virtual bool runMatchListParam (const NamedList &list, MatchingParams *params=0) const
 
virtual MatchingItemBase * copy () const
 
virtual const MatchingItemString * itemString () const
 
virtual const MatchingItemRegexp * itemRegexp () 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)
 

Friends

class MatchingItemList
 

Additional Inherited Members

- 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

Matching item common interface.

Base class for all matching items

Constructor & Destructor Documentation

◆ MatchingItemBase()

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

Constructor

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

Member Function Documentation

◆ copy()

virtual MatchingItemBase * copy ( ) const
inlinevirtual

Copy this item

Returns
MatchingItemBase pointer, NULL if not implemented

Reimplemented in MatchingItemList, MatchingItemRandom, MatchingItemRegexp, and MatchingItemString.

◆ dump()

virtual String & dump ( String & buf,
const MatchingItemDump * dump = 0,
const String & indent = String::empty(),
const String & origIndent = String::empty(),
unsigned int depth = 0 ) const
inlinevirtual

Dump this item

Parameters
bufDestination buffer
indentIndent for each item (line). Increased by 'origIndent' when depth advances
origIndentOriginal indent
dumpOptional dumper
depthRe-enter depth
Returns
Destination buffer reference

◆ dumpValue()

virtual String & dumpValue ( String & buf,
const MatchingItemDump * dump = 0,
const String & indent = String::empty(),
const String & origIndent = String::empty(),
unsigned int depth = 0 ) const
inlinevirtual

Dump this item's value

Parameters
bufDestination buffer
dumpOptional dumper
indentIndent for each item (line). Increased by 'origIndent' when depth advances
origIndentOriginal indent
depthRe-enter depth
Returns
Destination buffer reference

◆ dumpXml()

virtual GenObject * dumpXml ( const MatchingItemDump * dump = 0,
unsigned int depth = 0 ) const
inlinevirtual

Dump this item in XML format

Parameters
dumpOptional dumper
depthRe-enter depth
Returns
XmlElement pointer, NULL if not dumped

◆ itemCustom()

virtual const MatchingItemCustom * itemCustom ( ) const
inlinevirtual

Check if this item is a MatchingItemCustom one

Returns
MatchingItemCustom pointer

Reimplemented in MatchingItemCustom.

◆ itemList()

virtual const MatchingItemList * itemList ( ) const
inlinevirtual

Check if this item is a MatchingItemList one

Returns
MatchingItemList pointer, NULL if this item is not a MatchingItemList

Reimplemented in MatchingItemList.

◆ itemRandom()

virtual const MatchingItemRandom * itemRandom ( ) const
inlinevirtual

Check if this item is a MatchingItemRandom one

Returns
MatchingItemRandom pointer

Reimplemented in MatchingItemRandom.

◆ itemRegexp()

virtual const MatchingItemRegexp * itemRegexp ( ) const
inlinevirtual

Check if this item is a MatchingItemRegexp one

Returns
MatchingItemRegexp pointer, NULL if this item is not a MatchingItemRegexp

Reimplemented in MatchingItemRegexp.

◆ itemString()

virtual const MatchingItemString * itemString ( ) const
inlinevirtual

Check if this item is a MatchingItemString one

Returns
MatchingItemString pointer, NULL if this item is not a MatchingItemString

Reimplemented in MatchingItemString.

◆ matchListParam()

bool matchListParam ( const NamedList & list,
MatchingParams * params = 0 ) const
inline

NamedList parameter match. Handles matching result negation

Parameters
listList to search for parameter match
paramsOptional parameters used during match
Returns
True if matches, false otherwise

Referenced by MessageFilter::matchesMsg().

◆ matchString()

bool matchString ( const String & str,
MatchingParams * params = 0 ) const
inline

String match. Handles matching result negation

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

Referenced by MessageFilter::matchesMsg().

◆ name()

const String & name ( ) const
inline

Retrieve the name of this item

Returns
Item name

◆ negated()

bool negated ( ) const
inline

Check if this item is negated when testing

Returns
True if negated, false otherwise

◆ runMatchListParam()

virtual bool runMatchListParam ( const NamedList & list,
MatchingParams * params = 0 ) const
inlinevirtual

NamedList parameter match

Parameters
listList to search for parameter match
paramsOptional parameters used during match
Returns
True if matches, false otherwise

Reimplemented in MatchingItemList, and MatchingItemRandom.

◆ runMatchString()

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

String match to be implemented by descendants

Parameters
strString to match
paramsOptional parameters used during match
Returns
False

Reimplemented in MatchingItemList, MatchingItemRandom, MatchingItemRegexp, and MatchingItemString.

◆ toString()

virtual const String & toString ( ) const
inlinevirtual

Retrieve item name (suitable for list retrieval)

Returns
Item name

Reimplemented from GenObject.


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