treewalk.h File Reference

#include <tchar.h>

Data Structures

struct  _TWOptions

Defines

#define TREEWALK_H__66C2542C_CBE1_11D6_9360_0020182E0D04__INCLUDED_
#define TREEWALK_API   __declspec(dllimport)
#define TW_WALKING_STOP   -1

Typedefs

typedef enum _TWErr_codes TWErr_codes
typedef void * TWHandle
typedef enum _TWType TWType
typedef _TWOptions TWOptions
typedef int(*) TWCandidateHandler (const TCHAR *candidate, void *data)
typedef BOOL(*) TWFilter (const TCHAR *candidate, void *data)

Enumerations

enum  _TWErr_codes { CANT_CREATE_FILELIST, CANT_LOAD_STOPPOINT, CANT_SAVE_STOPPOINT }
enum  _TWType { level_order, pre_order, post_order, in_order }

Functions

TREEWALK_API int TWNewHandle (TWHandle *handle, const TWOptions *options)
TREEWALK_API int TWScanDirTree (const TWHandle handle, const TCHAR *path, TWCandidateHandler ch, TWFilter filter, void *data)
TREEWALK_API int TWDelHandle (TWHandle handle)

Detailed Description

Intrface of Treewalk library

Define Documentation

#define TREEWALK_API   __declspec(dllimport)

#define TREEWALK_H__66C2542C_CBE1_11D6_9360_0020182E0D04__INCLUDED_

#define TW_WALKING_STOP   -1

return-code from TWScanDirTree call bach function which tell to stop wree-walking and save a stop-point to given file.


Typedef Documentation

typedef int(*) TWCandidateHandler(const TCHAR *candidate, void *data)

Input: candidate_path - The founded file candidate Output: ReturnCode The function is called for each file provided by TWScanDirTree(). The function implements a file handling code. The returned ReturnCode value is used by the tree-walk code to indetify stop condition: TW_WALKING_STOP

typedef enum _TWErr_codes TWErr_codes

Error codes

typedef BOOL(*) TWFilter(const TCHAR *candidate, void *data)

Input: candidate_path - The founded file candidate Output: ReturnCode The function is called for each file AND DIRECTORY provided by TWScanDirTree(). The function do filtration of file-candidates and directories. It must return TRUE if the candidate is met to the filter.

typedef void* TWHandle

Tree-walk context handle

typedef struct _TWOptions TWOptions

Tree-walk options

typedef enum _TWType TWType

Type of directory tree traversal


Enumeration Type Documentation

enum _TWErr_codes

Error codes

Enumerator:
CANT_CREATE_FILELIST  Unable to create list of files from a directory.
CANT_LOAD_STOPPOINT  Unable to read from a file which contains a stop-point.
CANT_SAVE_STOPPOINT  Unable to write to a file which contains a stop-point.

enum _TWType

Type of directory tree traversal

Enumerator:
level_order  level order directory tree traversal
pre_order  pre-order (prefix) traversal
post_order  post-order (postfix) traversal
in_order  in-order (infix) traversal


Function Documentation

TREEWALK_API int TWDelHandle ( TWHandle  handle  ) 

Input: TWHandle Output: ReturnCode The TWDelHandle function releases all allocated resources.

TREEWALK_API int TWNewHandle ( TWHandle handle,
const TWOptions options 
)

Input: const TWOptions * options contains properties of new tree-walk instance

Output: TWHandle * handle

The TWNewHandle function returns a context handle to the calling thread for allowing reentrant processing.

TREEWALK_API int TWScanDirTree ( const TWHandle  handle,
const TCHAR *  path,
TWCandidateHandler  ch,
TWFilter  filter,
void *  data 
)

Input: TWHandle - handle of tree walk, path - path to subtree for start walking ch - pointer to callback function TWCandidateHandler() data - pointer to any data which you want to send to the call-back function. Output: ReturnCode The tree traversal process is done in TWScanDirTree function and for every file candidate the provided handler is called.


Generated on Sat Mar 24 19:52:43 2007 for treewalk by  doxygen 1.5.1-p1