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 Member Functions inherited from ucommon::stringpager
void add (char *text)
 Add text to list.
void add (char **list)
 Add list to list.
stringpager::memberbegin (void)
 Get root of pager list.
void clear (void)
 Purge all members and release pager member.
unsigned count (void)
 Get the number of items in the pager string list.
void operator+= (char *text)
 Convenience operator to add to pager and auto-sort.
stringpageroperator<< (char *text)
 Convenience operator to add to pager.
void sort (void)
 Sort members.
 stringpager (size_t pagesize=256)
 Create a pager with a maximum page size.

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.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 361 of file memory.h.


Member Function Documentation

virtual bool ucommon::DirPager::filter ( char *  filename)
protectedvirtual

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: