xmltooling 3.0.4

Public Types | Public Member Functions | List of all members
xmltooling::DirectoryWalker Class Reference

Portable directory walker that invokes a callback function for every file in a directory, optionally doing depth-first recursion of nested directories. More...

`#include <xmltooling/util/DirectoryWalker.h>`

## Public Types
typedef void(* | DirectoryWalkerCallback) (const char *pathname, struct stat &stat_buf, void *data)
| Callback function, passed the file pathname, stat buffer, and optional callback data.

## Public Member Functions
| DirectoryWalker (logging::Category &log, const char *path, bool recurse=false)
| Constructor. More...
void | walk (const DirectoryWalkerCallback &callback_fn, void *callback_data=0, const char *startsWith=0, const char *endsWith=0) const
| Perform a depth-first traversal of the directory. More...

## Detailed Description

Portable directory walker that invokes a callback function for every file in a directory, optionally doing depth-first recursion of nested directories.

## Constructor & Destructor Documentation

## ◆ DirectoryWalker()

xmltooling::DirectoryWalker::DirectoryWalker | ( | logging::Category & | log,
|  | const char * | path,
|  | bool | recurse = `false`
| ) |  |

Constructor.

Parameters

  log | log category
  path | directory path to walk
  recurse | true iff nested directories should be processed

## Member Function Documentation

## ◆ walk()

void xmltooling::DirectoryWalker::walk | ( | const DirectoryWalkerCallback & | callback_fn,
|  | void * | callback_data = `0`,
|  | const char * | startsWith = `0`,
|  | const char * | endsWith = `0`
| ) |  | const
| inline

Perform a depth-first traversal of the directory.

Parameters

  callback_fn | callback function to invoke for each match
  callback_data | optional pointer to pass to callback
  startsWith | optional prefix matching, skipping non-matching entries
  endsWith | optional suffix matching, skipping non-matching entries

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

- xmltooling/util/DirectoryWalker.h