WvStreams
wvdiriterex.cc
1 /*
2  * A WvDirIter example.
3  *
4  * Takes a directory on the command line, and
5  * prints everything it sees.
6  *
7  */
8 
9 #include "wvdiriter.h"
10 
11 int main()
12 {
13  WvString dirname(".");
14  // or WvString dirname("/home/user/");
15  // dirname contains the directory you want to list
16 
17  bool recurse = false;
18  // If true, do recursively
19 
20  WvDirIter i( dirname, recurse );
21 
22  for( i.rewind(); i.next(); ) {
23  printf( "%s \n", (const char *) i->fullname);
24  }
25  // prints something like:
26  // ./a.txt
27  // ./b.txt
28  // ./c.txt
29 
30  return( 0 );
31 }
WvString
WvString is an implementation of a simple and efficient printable-string class.
Definition: wvstring.h:329
WvDirIter
Definition: wvdiriter.h:31