Directory pager is a paged string list for directory file names.
More...
#include <memory.h>
Public Member Functions |
| DirPager (char *path) |
char * | get (unsigned item) |
| Get string item from list.
|
| operator bool () |
bool | operator! () |
char * | operator* () |
void | operator= (char *path) |
char * | operator[] (unsigned item) |
| Return specified filename from directory list.
|
Protected Member Functions |
virtual bool | filter (char *filename) |
| Filter filenames in a derived class.
|
bool | load (char *path) |
| Load a directory path.
|
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.
|
void | operator+= (char *text) |
| Convenience operator to add to pager and auto-sort.
|
stringpager & | operator<< (char *text) |
| Convenience operator to add to pager.
|
void | sort (void) |
| Sort members.
|
| stringpager (size_t pagesize=256) |
| Create a pager with a maximum page size.
|
Protected Attributes |
char * | dir |
Detailed Description
Directory pager is a paged string list for directory file names.
This protocol is used to convert a directory into a list of filenames. As a protocol it offers a filtering method to select which files to include in the list.
- Author:
- David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org
Definition at line 361 of file memory.h.
Member Function Documentation
virtual bool ucommon::DirPager::filter |
( |
char * |
filename | ) |
|
|
protectedvirtual |
Filter filenames in a derived class.
- Parameters:
-
- Returns:
- true if include in final list.
char* ucommon::DirPager::get |
( |
unsigned |
item | ) |
|
|
inline |
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.
Reimplemented from ucommon::stringpager.
Definition at line 405 of file memory.h.
bool ucommon::DirPager::load |
( |
char * |
path | ) |
|
|
protected |
Load a directory path.
- Parameters:
-
- Returns:
- true if valid.
char* ucommon::DirPager::operator[] |
( |
unsigned |
item | ) |
|
|
inline |
Return specified filename from directory list.
This is a convenience operator.
- Parameters:
-
- Returns:
- text of item or NULL if invalid.
Reimplemented from ucommon::stringpager.
Definition at line 402 of file memory.h.
The documentation for this class was generated from the following file: