vul_file_iterator Class Reference

#include <vul_file_iterator.h>

List of all members.


Detailed Description

Iterate through directories and/or "glob" patterns (*.

*). It is efficient to use

   for (vul_file_iterator fn="/dir/*"; fn; ++fn) {
     ... use fn() as filename
   }
simply to list the contents of a directory. If you really want just the *.ext files, it is efficient to use
   for (vul_file_iterator fn="/dir/*.ext"; fn; ++fn) {
     ... use fn() as filename
   }
rather than opendir/glob/etc.

Valid glob patterns are unix-like - '?' matches precisely one character '*' matches any sequence (including empty), [abc] matches either 'a' or 'b' or 'c'

Definition at line 43 of file vul_file_iterator.h.


Public Member Functions

 vul_file_iterator ()
 vul_file_iterator (char const *glob)
 Initialize, and scan to get first file from "glob".
 vul_file_iterator (vcl_string const &glob)
 Initialize, and scan to get first file from "glob".
 ~vul_file_iterator ()
 operator safe_bool () const
 Ask if done.
bool operator! () const
 Inverse boolean value.
char const * operator() ()
 Return the currently pointed-to pathname.
char const * filename ()
 Return the non-directory part of the current pathname.
char const * match (int i)
 Return the match for the i'th glob wildcard character (* or ?).
vul_file_iteratoroperator++ ()
 Increment to the next file.
void reset (char const *glob)
 Run a new match.

Protected Attributes

vul_file_iterator_datap

Private Member Functions

vul_file_iterator operator++ (int)

Private Attributes

 VCL_SAFE_BOOL_DEFINE

Constructor & Destructor Documentation

vul_file_iterator::vul_file_iterator (  )  [inline]

Definition at line 48 of file vul_file_iterator.h.

vul_file_iterator::vul_file_iterator ( char const *  glob  ) 

Initialize, and scan to get first file from "glob".

Definition at line 259 of file vul_file_iterator.cxx.

vul_file_iterator::vul_file_iterator ( vcl_string const &  glob  ) 

Initialize, and scan to get first file from "glob".

Definition at line 265 of file vul_file_iterator.cxx.

vul_file_iterator::~vul_file_iterator (  ) 

Definition at line 271 of file vul_file_iterator.cxx.


Member Function Documentation

vul_file_iterator::operator vul_file_iterator::safe_bool (  )  const

Ask if done.

Won't spin the disk

Definition at line 292 of file vul_file_iterator.cxx.

bool vul_file_iterator::operator! (  )  const

Inverse boolean value.

Definition at line 297 of file vul_file_iterator.cxx.

char const * vul_file_iterator::operator() (  ) 

Return the currently pointed-to pathname.

Won't spin the disk

Definition at line 282 of file vul_file_iterator.cxx.

char const * vul_file_iterator::filename (  ) 

Return the non-directory part of the current pathname.

Definition at line 287 of file vul_file_iterator.cxx.

char const* vul_file_iterator::match ( int  i  ) 

Return the match for the i'th glob wildcard character (* or ?).

Uses the most recent glob result.

vul_file_iterator & vul_file_iterator::operator++ (  ) 

Increment to the next file.

Will spin the disk

Definition at line 302 of file vul_file_iterator.cxx.

void vul_file_iterator::reset ( char const *  glob  ) 

Run a new match.

Definition at line 276 of file vul_file_iterator.cxx.

vul_file_iterator vul_file_iterator::operator++ ( int   )  [inline, private]

Definition at line 88 of file vul_file_iterator.h.


Member Data Documentation

vul_file_iterator::VCL_SAFE_BOOL_DEFINE [private]

Definition at line 45 of file vul_file_iterator.h.

vul_file_iterator_data* vul_file_iterator::p [protected]

Definition at line 84 of file vul_file_iterator.h.


The documentation for this class was generated from the following files:
Generated on Tue Dec 2 05:08:49 2008 for core/vul by  doxygen 1.5.1