CSIBCSearchPath Class Reference

Class dealing with paths and filenames. More...

#include <SIBCSearchPath.h>

List of all members.

Public Member Functions

  CSIBCSearchPath ()
SI_Error  AddPath (CSIBCString &in_Path)
SI_Error  ClearPaths ()
SI_Error  Search (CSIBCString &file, CSIBCString &resultpath)
SI_Error  GetFiles (CSIBCString &in_Filter, CSIBCArray< CSIBCString * > *out_pFiles)
SI_Error  GetDirectories (CSIBCString &in_Filter, CSIBCArray< CSIBCString * > *out_pDirs)
CSIBCArray< CSIBCString * > &  GetPaths ()


Detailed Description

Class dealing with paths and filenames.

This class provides an easy method for locating files within designated search paths


Constructor & Destructor Documentation

CSIBCSearchPath (  ) 

Default Constructor. Initializes a CSIBCSearchPath object.


Member Function Documentation

SI_Error AddPath ( CSIBCString in_Path  ) 

Adds a search path to this object. Subsequent calls to CSIBCSearchPath::Search, and CSIBCSearchPath::GetFiles will look in this path for matching files.

Parameters:
in_Path  String containing the full path.
Returns:
SI_Error Error code indicating the success or failure of this command.
returns: SI_SUCCESS - The search path was added successfully.

See also:
CSIBCSearchPath::GetPaths

CSIBCSearchPath::ClearPaths

SI_Error ClearPaths (  ) 

Clears all search paths associated with this object.

Returns:
SI_Error Error code indicating the success or failure of this command.
returns: SI_SUCCESS - The search path was added successfully.

See also:
CSIBCSearchPath::AddPath

CSIBCSearchPath::GetPaths

SI_Error Search ( CSIBCString file,
CSIBCString resultpath  
)

Searches for a file named file, in the search paths added with CSIBCSearchPath::AddPath.

Parameters:
file  Filename to search for.
resultpath  Contains the full path and filename of the file, if found.
Returns:
SI_Error Error code indicating the success or failure of this command.
returns: SI_SUCCESS - The file was located. resultpath contains the path and filename. SI_FILE_NOT_FOUND - The file could not be found (resultpath is unchanged).

See also:
CSIBCSearchPath::GetFiles

CSIBCSearchPath::AddPath

CSIBCSearchPath::GetPaths

SI_Error GetFiles ( CSIBCString in_Filter,
CSIBCArray< CSIBCString * > *  out_pFiles  
)

Returns an array of all files matching in_Filter in the search paths for this object. This function will also return any directories matching the search filter.

Parameters:
in_Filter  The filename to search for (can include wildcards).
out_pFiles  Pointer to an array of strings to append the full paths and filenames of files matched to in_Filter in this object's search paths. The strings added to this array must be freed by the caller.
returns: SI_SUCCESS - The command was successful.

See also:
CSIBCSearchPath::GetDirectories

CSIBCSearchPath::Search

CSIBCSearchPath::AddPath

CSIBCSearchPath::GetPaths

SI_Error GetDirectories ( CSIBCString in_Filter,
CSIBCArray< CSIBCString * > *  out_pDirs  
)

Function exactly like GetFiles, except that only directories matching the filter are returned.

Parameters:
in_Filter  The filename to search for (can include wildcards).
out_pFiles  Pointer to an array of strings to append the full paths of directories matched to in_Filter in this object's search paths. The strings added to this array must be freed by the caller.
returns: SI_SUCCESS - The command was successful.

See also:
CSIBCSearchPath::GetFiles

CSIBCSearchPath::Search

CSIBCSearchPath::AddPath

CSIBCSearchPath::GetPaths

CSIBCArray< CSIBCString * >& GetPaths (  )  [inline]

Returns the array containing the search paths defined for this object.

Returns:
CSIBCArray<CSIBCString*>& Reference to the array containing the search paths for this object.
See also:
CSIBCSearchPath::AddPath

CSIBCSearchPath::ClearPaths


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