String pager for storing lists of NULL terminated strings.
More...
#include <memory.h>
Data Structures |
class | member |
| Member of string list. More...
|
Public Member Functions |
void | add (char *text) |
| Add text to list.
|
void | add (char **list) |
| Add list to list.
|
stringpager::member * | begin (void) |
| Get root of pager list.
|
void | clear (void) |
| Purge all members and release pager member.
|
unsigned | count (void) |
| Get the number of items in the pager string list.
|
char * | get (unsigned item) |
| Get string item from list.
|
void | operator+= (char *text) |
| Convenience operator to add to pager.
|
stringpager & | operator<< (char *text) |
| Convenience operator to add to pager.
|
char * | operator[] (unsigned item) |
| Return specified member from pager list.
|
| stringpager (size_t pagesize=256) |
| Create a pager with a maximum page size.
|
Detailed Description
String pager for storing lists of NULL terminated strings.
This is used for accumulating lists which can be destroyed all at once.
- Author:
- David Sugar <dyfet@gnutelephony.org>
Definition at line 239 of file memory.h.
Constructor & Destructor Documentation
Create a pager with a maximum page size.
- Parameters:
-
size | of pager allocation pages. |
Member Function Documentation
Add text to list.
- Parameters:
-
Add list to list.
This is a list of string pointers terminated with NULL.
- Parameters:
-
Get root of pager list.
This is useful for externally enumerating the list of strings.
- Returns:
- first member of list or NULL if empty.
Definition at line 320 of file memory.h.
Purge all members and release pager member.
The list can then be added to again.
Get the number of items in the pager string list.
- Returns:
- number of items stored.
Definition at line 276 of file memory.h.
Get string item from list.
This is useful when stringpager is passed as a pointer and hence inconvenient for the [] operator.
- Parameters:
-
- Returns:
- pointer to text for item, or NULL if out of range.
void ucommon::stringpager::operator+= |
( |
char * |
text | ) |
[inline] |
Convenience operator to add to pager.
- Parameters:
-
Definition at line 327 of file memory.h.
stringpager& ucommon::stringpager::operator<< |
( |
char * |
text | ) |
[inline] |
Convenience operator to add to pager.
- Parameters:
-
Definition at line 334 of file memory.h.
char* ucommon::stringpager::operator[] |
( |
unsigned |
item | ) |
[inline] |
Return specified member from pager list.
This is a convenience operator.
- Parameters:
-
- Returns:
- text of item or NULL if invalid.
Definition at line 312 of file memory.h.
The documentation for this class was generated from the following file: