DataDirector API
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DDD_DirectoryTraverser Class Referenceabstract
Inheritance diagram for DDD_DirectoryTraverser:
DDD_LogFacade

Public Member Functions

bool TraverseDirectory (const std::string &pathToTraverse)
 

Protected Member Functions

virtual bool ProcessFile (const std::string &fileName)=0
 
void ProcessFiles (int numberOfFilesInDirectory, dirent **files)
 

Protected Attributes

std::string _fileExtension
 

Additional Inherited Members

- Static Public Member Functions inherited from DDD_LogFacade
static void LogDebug (const char *format,...)
 
static void LogInfo (const char *format,...)
 
static void LogWarning (const char *format,...)
 
static void LogError (const char *format,...)
 

Member Function Documentation

virtual bool ProcessFile ( const std::string &  fileName)
protectedpure virtual

ProcessFile is called whenever a file with a matching extension is found by the traverser Subclasses will provide their own implementation of this method to do whatever processing is needed for each file

Parameters
fileNameThe name of the file that was found with the matching extension
Returns
True if the file was successfully processed, false otherwise
void ProcessFiles ( int  numberOfFilesInDirectory,
dirent **  files 
)
protected

Helper method used by TraverseDirectory. Processes the file list from the directory, calling ProcessFile on each file that matched the extension

Parameters
numberOfFilesInDirectoryThe number of files that are in the next parameter
filesData stucture containing the list of files in the directory
bool TraverseDirectory ( const std::string &  pathToTraverse)

Searches a directory, then if the directory was readable and has files in it, processes the file list from the directory

Parameters
pathToTraverseThe directory to Process
Returns
True if the path was successfully searched

Member Data Documentation

std::string _fileExtension
protected

The file extension to search for when traversing. Must take the form of a dot followed by a single extension, e.g. ".xyz" or ".xyzLinux"


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