|
Yate
|
A list of matching items. More...
#include <yateclass.h>
Public Member Functions | |
| MatchingItemList (const char *name, bool matchAll=true, bool negated=false) | |
| bool | matchAll () const |
| unsigned int | length () const |
| unsigned int | count () const |
| const MatchingItemBase * | at (unsigned int index) const |
| int | indexOf (const String &name) const |
| const MatchingItemBase * | find (const String &name) const |
| bool | change (MatchingItemBase *item, int pos=-1, bool ins=false, unsigned int overAlloc=1) |
| bool | append (MatchingItemBase *item, unsigned int overAlloc=1) |
| void | append (ObjList &list) |
| bool | set (MatchingItemBase *item, unsigned int pos, unsigned int overAlloc=1) |
| bool | insert (MatchingItemBase *item, unsigned int pos=0, unsigned int overAlloc=1) |
| 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 MatchingItemList * | itemList () 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 const MatchingItemString * | itemString () const |
| virtual const MatchingItemRegexp * | itemRegexp () const |
| virtual const MatchingItemRandom * | itemRandom () 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 MatchingItemBase * | optimize (MatchingItemList *list) |
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 () |
A list of matching items.
List of matching items
|
inline |
Constructor
| name | Item name |
| matchAll | True to match all items (logical AND), false to match any item (logical OR) |
| negated | True if matching is negated (return the opposite of match in public methods), false otherwise |
|
inline |
Append an item to the list
| item | Item to append, pointer will be consumed |
| overAlloc | Optional number of items to over allocate This parameter is ignored if there is enough space in the list set append the item |
|
inline |
Append a list of items to the list
| list | Items list |
References ObjList::count(), ObjList::remove(), and ObjList::skipNull().
|
inline |
Retrieve a pointer to item at given index
| index | Index to retrieve |
| bool change | ( | MatchingItemBase * | item, |
| int | pos = -1, | ||
| bool | ins = false, | ||
| unsigned int | overAlloc = 1 ) |
Change list (append,insert,replace,remove) Item is removed if given pointer is NULL, position is valid and 'ins' is false
| item | Item to set, pointer will be consumed |
| pos | Item position. Append if negative or past list length |
| ins | Set it to true to insert, false to replace or append |
| overAlloc | Optional number of items to over allocate This parameter is ignored if there is enough space in the list set append the item |
|
virtual |
|
inline |
Retrieve the number of non empty items in list
|
inline |
|
inline |
Retrieve the index of an item found by name
| name | Item name |
|
inline |
Insert an item at list start
| item | Item to insert, pointer will be consumed |
| pos | Item position. Append if past list length |
| overAlloc | Optional number of items to over allocate This parameter is ignored if there is enough space in the list set append the item |
|
inlinevirtual |
Check if this item is a MatchingItemList one
Reimplemented from MatchingItemBase.
|
inline |
Retrieve the list length
|
inline |
Check if all items must match
|
static |
Optimize a MatchingItemList Delete list if empty or there is only one item in it, return the first item in it any
| list | List to optimize |
|
virtual |
NamedList parameter match
| list | List to search for parameter match |
| params | Optional parameters used during match |
Reimplemented from MatchingItemBase.
|
virtual |
String match
| str | String to match |
| params | Optional parameters used during match |
Reimplemented from MatchingItemBase.
|
inline |
Set an item at given position Item is removed if given pointer is NULL
| item | Item to set, pointer will be consumed |
| pos | Item position. Append if past list length |
| overAlloc | Optional number of items to over allocate This parameter is ignored if there is enough space in the list set append the item |