UCommon
|
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 and auto-sort. | |
stringpager & | operator<< (char *text) |
Convenience operator to add to pager. | |
char * | operator[] (unsigned item) |
Return specified member from pager list. | |
void | sort (void) |
Sort members. | |
stringpager (size_t pagesize=256) | |
Create a pager with a maximum page size. |
String pager for storing lists of NULL terminated strings.
This is used for accumulating lists which can be destroyed all at once.
ucommon::stringpager::stringpager | ( | size_t | pagesize = 256 | ) |
Create a pager with a maximum page size.
size | of pager allocation pages. |
void ucommon::stringpager::add | ( | char * | text | ) |
Add text to list.
text | to add. |
void ucommon::stringpager::add | ( | char ** | list | ) |
Add list to list.
This is a list of string pointers terminated with NULL.
list | of text to add. |
stringpager::member* ucommon::stringpager::begin | ( | void | ) | [inline] |
void ucommon::stringpager::clear | ( | void | ) |
Purge all members and release pager member.
The list can then be added to again.
unsigned ucommon::stringpager::count | ( | void | ) | [inline] |
char* ucommon::stringpager::get | ( | unsigned | item | ) |
Get string item from list.
This is useful when stringpager is passed as a pointer and hence inconvenient for the [] operator.
item | to access. |
Reimplemented in ucommon::DirPager.
void ucommon::stringpager::operator+= | ( | char * | text | ) | [inline] |
stringpager& ucommon::stringpager::operator<< | ( | char * | text | ) | [inline] |
char* ucommon::stringpager::operator[] | ( | unsigned | item | ) | [inline] |
Return specified member from pager list.
This is a convenience operator.
item | to access. |
Reimplemented in ucommon::DirPager.