UCommon
Public Member Functions | Protected Member Functions | Protected Attributes
ucommon::DirPager Class Reference

Directory pager is a paged string list for directory file names. More...

#include <memory.h>

Inheritance diagram for ucommon::DirPager:
Inheritance graph
[legend]
Collaboration diagram for ucommon::DirPager:
Collaboration graph
[legend]

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

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@gnutelephony.org>

Definition at line 594 of file memory.h.


Member Function Documentation

unsigned ucommon::DirPager::count ( void  ) const [inline]

Get the number of items in the pager string list.

Returns:
number of items stored.

Reimplemented from ucommon::StringPager.

Definition at line 631 of file memory.h.

Here is the call graph for this function:

virtual bool ucommon::DirPager::filter ( char *  filename,
size_t  size 
) [protected, virtual]

Filter filenames in a derived class.

The default filter drops "." special files.

Parameters:
filenameto filter.
sizeof filename buffer.
Returns:
true if include in final list.

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.

Parameters:
itemto access.
Returns:
pointer to text for item, or NULL if out of range.

Reimplemented from ucommon::StringPager.

Definition at line 643 of file memory.h.

Here is the call graph for this function:

bool ucommon::DirPager::load ( const char *  path) [protected]

Load a directory path.

Parameters:
pathto load.
Returns:
true if valid.
const char* ucommon::DirPager::operator[] ( unsigned  item) const [inline]

Return specified filename from directory list.

This is a convenience operator.

Parameters:
itemto access.
Returns:
text of item or NULL if invalid.

Reimplemented from ucommon::StringPager.

Definition at line 640 of file memory.h.

Here is the call graph for this function:

unsigned ucommon::DirPager::pages ( void  ) const [inline]

Get the number of pages that have been allocated from the real heap.

Returns:
pages allocated from heap.

Reimplemented from ucommon::StringPager.

Definition at line 652 of file memory.h.

Here is the call graph for this function:

size_t ucommon::DirPager::size ( void  ) const [inline]

Get the size of a memory page.

Returns:
size of each pager heap allocation.

Reimplemented from ucommon::StringPager.

Definition at line 649 of file memory.h.

Here is the call graph for this function:


The documentation for this class was generated from the following file: