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

 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.

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 361 of file memory.h.


Member Function Documentation

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

Filter filenames in a derived class.

Parameters:
filenameto filter.
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:
itemto access.
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:
pathto load.
Returns:
true if valid.
char* ucommon::DirPager::operator[] ( unsigned  item) [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 402 of file memory.h.


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