UCommon
|
Directory pager is a paged string list for directory file names. More...
#include <memory.h>
Public Member Functions | |
const char * | at (unsigned item) const |
unsigned | count (void) const |
Get the number of items in the pager string list. | |
DirPager (const char *path) | |
const char * | get (unsigned item) const |
Get string item from list. | |
operator bool () const | |
bool | operator! () const |
const char * | operator* () const |
void | operator= (const char *path) |
const char * | operator[] (unsigned item) const |
Return specified filename from directory list. | |
unsigned | pages (void) const |
Get the number of pages that have been allocated from the real heap. | |
size_t | size (void) const |
Get the size of a memory page. | |
Protected Member Functions | |
virtual bool | filter (char *filename, size_t size) |
Filter filenames in a derived class. | |
bool | load (const char *path) |
Load a directory path. | |
Protected Attributes | |
const char * | dir |
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.
unsigned ucommon::DirPager::count | ( | void | ) | const [inline] |
Get the number of items in the pager string list.
Reimplemented from ucommon::StringPager.
Definition at line 631 of file memory.h.
virtual bool ucommon::DirPager::filter | ( | char * | filename, |
size_t | size | ||
) | [protected, virtual] |
Filter filenames in a derived class.
The default filter drops "." special files.
filename | to filter. |
size | of filename buffer. |
Reimplemented from ucommon::StringPager.
const char* ucommon::DirPager::get | ( | unsigned | item | ) | const [inline] |
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 from ucommon::StringPager.
Definition at line 643 of file memory.h.
bool ucommon::DirPager::load | ( | const char * | path | ) | [protected] |
Load a directory path.
path | to load. |
const char* ucommon::DirPager::operator[] | ( | unsigned | item | ) | const [inline] |
Return specified filename from directory list.
This is a convenience operator.
item | to access. |
Reimplemented from ucommon::StringPager.
Definition at line 640 of file memory.h.
unsigned ucommon::DirPager::pages | ( | void | ) | const [inline] |
Get the number of pages that have been allocated from the real heap.
Reimplemented from ucommon::StringPager.
Definition at line 652 of file memory.h.
size_t ucommon::DirPager::size | ( | void | ) | const [inline] |
Get the size of a memory page.
Reimplemented from ucommon::StringPager.
Definition at line 649 of file memory.h.