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

char * at (unsigned item)
unsigned count (void)
 Get the number of items in the pager string list.
 DirPager (char *path)
char * get (unsigned item)
 Get string item from list.
char * operator * ()
 operator bool ()
bool operator! ()
void operator= (char *path)
char * operator[] (unsigned item)
 Return specified filename from directory list.
unsigned pages (void)
 Get the number of pages that have been allocated from the real heap.
size_t size (void)
 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 (char *path)
 Load a directory path.

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

Definition at line 593 of file memory.h.


Member Function Documentation

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

Get the number of items in the pager string list.

Returns:
number of items stored.

Reimplemented from ucommon::StringPager.

Definition at line 630 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.

Parameters:
filename to filter.
size of filename buffer.
Returns:
true if include in final list.

Reimplemented from ucommon::StringPager.

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:
item to access.
Returns:
pointer to text for item, or NULL if out of range.

Reimplemented from ucommon::StringPager.

Definition at line 642 of file memory.h.

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

Load a directory path.

Parameters:
path to load.
Returns:
true if valid.

char* ucommon::DirPager::operator[] ( unsigned  item  )  [inline]

Return specified filename from directory list.

This is a convenience operator.

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

Reimplemented from ucommon::StringPager.

Definition at line 639 of file memory.h.

unsigned ucommon::DirPager::pages ( void   )  [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 651 of file memory.h.

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

Get the size of a memory page.

Returns:
size of each pager heap allocation.

Reimplemented from ucommon::StringPager.

Definition at line 648 of file memory.h.


The documentation for this class was generated from the following file:
Generated on 14 Aug 2013 for UCommon by  doxygen 1.4.7