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)
size_t size (void)

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 593 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 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.

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:
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 ( const char *  path  )  [protected]

Load a directory path.

Parameters:
path to 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:
item to access.
Returns:
text of item or NULL if invalid.

Reimplemented from ucommon::StringPager.

Definition at line 639 of file memory.h.


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

Generated on 30 Jul 2013 for UCommon by  doxygen 1.6.1