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 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 runMatchString (const String &str, MatchingParams *params=0) const
virtual bool runMatchListParam (const NamedList &list, MatchingParams *params=0) const
virtual MatchingItemBasecopy () const
virtual const MatchingItemStringitemString () const
virtual const MatchingItemRegexpitemRegexp () 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)

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 NamedCountergetObjCounter (const String &name, bool create=true)
static ObjListgetObjCounters ()

Detailed Description

Matching item common interface.

Base class for all matching items

Constructor & Destructor Documentation

◆ MatchingItemBase()

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.

References MatchingItemBase().

◆ 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

References dump(), and String::empty().

Referenced by dump(), dumpValue(), and dumpXml().

◆ 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

References dump(), and String::empty().

◆ 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

References dump(), and GenObject::GenObject().

◆ 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

References runMatchListParam().

◆ 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

References runMatchString().

◆ name()

◆ negated()

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

References name(), and runMatchString().

Referenced by matchListParam().

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

Referenced by matchString(), and runMatchListParam().

◆ toString()

virtual const String & toString ( ) const
inlinevirtual

Retrieve item name (suitable for list retrieval)

Returns
Item name

Reimplemented from GenObject.

References name().


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