Download Source Code

CFileSearch Class Reference

Provides file searching capability. More...

#include <FileSearch.h>

Inheritance diagram for CFileSearch:

Inheritance graph
[legend]
Collaboration diagram for CFileSearch:

Collaboration graph
[legend]
List of all members.

Public Member Functions

BOOL FindString (LPCTSTR pText, LPCTSTR pDir, LPCTSTR pExt, LPCTSTR pLoc=NULL)
 Searches files for a particular text string.
BOOL AddFile (LPCTSTR pFile, LPCTSTR pLoc)
 Adds a file to the list.
BOOL Search (LPCTSTR pText, LPCTSTR pDir, LPCTSTR pExt)
 Searches for the particular text string.
virtual DWORD GetObjSize ()
 Returns the size of a file search element structure.
 CFileSearch ()
 Constructor.
virtual ~CFileSearch ()
 Destructor.

Static Public Member Functions

static BOOL GetExtension (DWORD ext, LPSTR pExt, LPCTSTR pExtList, BYTE sep= ';')
 Returns the specified extension from the list.
static BOOL IsToken (LPCTSTR buf, DWORD len, LPCTSTR token)
 Searches a buffer for a string.
static BOOL FindInFile (LPCTSTR pString, LPCTSTR pFile)
 Searches a file for a string.
static BOOL FindInMem (LPCTSTR pString, LPCTSTR buf, DWORD size)
 Searches a buffer for the specified string.

Detailed Description

Provides file searching capability.

This class can be used to search files for particular strings.


Member Function Documentation

BOOL CFileSearch::AddFile LPCTSTR  pFile,
LPCTSTR  pLoc
 

Adds a file to the list.

Parameters:
[in] pFile - Filename
[in] pLoc - File location
Returns:
Non-zero if success
See also:

BOOL CFileSearch::FindInFile LPCTSTR  pString,
LPCTSTR  pFile
[static]
 

Searches a file for a string.

Parameters:
[in] pString - String to find
[in] pFile - Name of file to search
Returns:
Non-zero if string is found in file
See also:

BOOL CFileSearch::FindInMem LPCTSTR  pString,
LPCTSTR  buf,
DWORD  size
[static]
 

Searches a buffer for the specified string.

Parameters:
[in] pString - String to find
[in] buf - Buffer to search
[in] size - Size of buffer in buf
Returns:
See also:

BOOL CFileSearch::FindString LPCTSTR  pText,
LPCTSTR  pDir,
LPCTSTR  pExt,
LPCTSTR  pLoc = NULL
 

Searches files for a particular text string.

Parameters:
[in] pText - Text string to search for
[in] pDir - Directory to start search
[in] pExt - File extensions to search
[in] pLoc - Tracks recursive file path
Returns:
Non-zero if success
See also:

BOOL CFileSearch::GetExtension DWORD  ext,
LPSTR  pExt,
LPCTSTR  pExtList,
BYTE  sep = ';'
[static]
 

Returns the specified extension from the list.

Parameters:
[in] ext - Index of extension to retrieve
[in] pExt - Buffer that receives extension
[in] pExtList - List of extensions separated by sep
[in] sep - Separator character
Returns:
Non-Zero if extension index is valid
See also:

BOOL CFileSearch::IsToken LPCTSTR  buf,
DWORD  len,
LPCTSTR  token
[static]
 

Searches a buffer for a string.

Parameters:
[in] buf - Buffer to search
[in] len - Size of buffer in buf
[in] token - Token to search for
Returns:
Non-zero if success
See also:

BOOL CFileSearch::Search LPCTSTR  pText,
LPCTSTR  pDir,
LPCTSTR  pExt
 

Searches for the particular text string.

Parameters:
[in] pText - Text to search for
[in] pDir - Directory to start search
[in] pExt - File extension
Returns:
Non-zero if success
See also:


The documentation for this class was generated from the following files:
  • inc/FileSearch.h
  • FileSearch.cpp
Copyright Robert Umbehant
This documentation is covered by the LGPL