Main Page | Class Hierarchy | Class List | Directories | File List | Class Members

FileHdr Class Reference

Searches directories to find source files. More...

#include <fileHdr.h>

List of all members.

Public Member Functions

 FileHdr ()
 Allocate space for storing the full path for file names.
 ~FileHdr ()
void handleFile (const char *filename)
 Sets mp_fullPath to absolute path, fn to relative path.
void scanDir (const char *dirName)
 Scan a directory for files and directories.
void addTraceString (const char *fullName)
 Constructs a AddTraceString object and hands it off.

Private Member Functions

void privateHdlFile (const char *fileName)

Private Attributes

char * mp_fullPath
 This variable holds the full path to the current file name.
int m_fullPathLen
 The current number of character in mp_fullPath.
int m_fullPathCapacity
 The max number of character available in mp_fullPath.


Detailed Description

Searches directories to find source files.

Description
This class is responsible for searching directories for source files. It will recursively descend a directory tree and send each source file to the ats object for actual instrumentation.
Design Considerations
  • It constructs a addTraceString object for each source file.
  • Source files are deemed to be files that have the following suffixes: .c .C .cpp .cxx .cc .h .hpp


Constructor & Destructor Documentation

FileHdr::FileHdr  ) 
 

Allocate space for storing the full path for file names.

Description
We use a char* buffer to hold the name of the full path for a file name. Also we hold the replacement object as we only need one version of this object which is needed for the addTraceString state context object.

FileHdr::~FileHdr  ) 
 

Description
Just cleaning up.


Member Function Documentation

void FileHdr::addTraceString const char *  fullName  ) 
 

Constructs a AddTraceString object and hands it off.

Description
This is just a wrapper.

void FileHdr::handleFile const char *  filename  ) 
 

Sets mp_fullPath to absolute path, fn to relative path.

Description
This routine is checks to see if the input fileName is a full path or not. Then calls privateHdlFile with mp_fullPath to the absolute path to the directory which has the file with a relative name in fn.

void FileHdr::privateHdlFile const char *  fileName  )  [private]
 

Description
This private member function requires that mp_fullpath have the absolute path to the file with the relative name in fileName. This routine then calls addTraceString on all regular files and scandir on all directories.

void FileHdr::scanDir const char *  dirName  ) 
 

Scan a directory for files and directories.

Description
This routine is only called when dirName contains a directory name. Each file name (except for ``.'' and ``..'') are then passed to privateHdlFile.


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



Project Hosted By:
SourceForge.net Logo