ERY.AgateLib.SearchPath Class Reference

A class which is used to simplify searching for files in several different directories. All paths entered are stored as absolute paths, so do not expect to add an item and retrieve it and have it be the same thing.
. More...

List of all members.

Public Member Functions

 SearchPath ()
 Constructs a SearchPath object. No default paths are added (You might want to consider using SearchPath(".") instead to include the current directory.).
 SearchPath (params string[] array)
 Constructs a SearchPath object, and adds all the paths specified to the list of paths to search.
 SearchPath (int levels, params string[] array)
 Constructs a SearchPath object, and adds all the paths specified to the list of paths to search, as well as subdirectories up to the level specified.
void Add (string item, int levels)
 Recursively adds the specified directory, and all subdirectories up to the specified number of levels deep.
string FindFileName (string filename)
 Searches through all directories in the SearchPath object for the specified filename. The search is performed in the order directories have been added, and the first result is returned. If no file is found, null is returned.
ICollection< string > GetAllFiles ()
 Gets all files in all paths.
ICollection< string > GetAllFiles (string searchPattern)
 Gets all files in all paths that match the specified search pattern.
void Add (string item)
 Adds a search path to the list.
void Clear ()
 Clears all search paths from the list.
bool Contains (string item)
 Checks to see if the given path is already in the list.
void CopyTo (string[] array, int arrayIndex)
 Copies the list of paths to an array.
bool Remove (string item)
 Removes an item from the search path list.
IEnumerator< string > GetEnumerator ()
 Gets an IEnumerator<string> object for iterating through the search paths.

Properties

int Count [get]
 Gets how many search paths are listed here.
string this [int index] [get, set]
 Returns a search path at a given index.


Detailed Description

A class which is used to simplify searching for files in several different directories. All paths entered are stored as absolute paths, so do not expect to add an item and retrieve it and have it be the same thing.
.


Constructor & Destructor Documentation

ERY.AgateLib.SearchPath.SearchPath (  ) 

Constructs a SearchPath object. No default paths are added (You might want to consider using SearchPath(".") instead to include the current directory.).

ERY.AgateLib.SearchPath.SearchPath ( params string[]  array  ) 

Constructs a SearchPath object, and adds all the paths specified to the list of paths to search.

Parameters:
array A comma delimited list of strings.

ERY.AgateLib.SearchPath.SearchPath ( int  levels,
params string[]  array 
)

Constructs a SearchPath object, and adds all the paths specified to the list of paths to search, as well as subdirectories up to the level specified.

Parameters:
levels How many subdirectories each to add.
array A comma delimited list of strings.


Member Function Documentation

void ERY.AgateLib.SearchPath.Add ( string  item,
int  levels 
)

Recursively adds the specified directory, and all subdirectories up to the specified number of levels deep.

Parameters:
item 
levels 

string ERY.AgateLib.SearchPath.FindFileName ( string  filename  ) 

Searches through all directories in the SearchPath object for the specified filename. The search is performed in the order directories have been added, and the first result is returned. If no file is found, null is returned.

Parameters:
filename Filename to search for.
Returns:
The full path of the file, if it exists. Null if no file is found.

ICollection<string> ERY.AgateLib.SearchPath.GetAllFiles (  ) 

Gets all files in all paths.

Returns:

ICollection<string> ERY.AgateLib.SearchPath.GetAllFiles ( string  searchPattern  ) 

Gets all files in all paths that match the specified search pattern.

Parameters:
searchPattern 
Returns:

void ERY.AgateLib.SearchPath.Add ( string  item  ) 

Adds a search path to the list.

Parameters:
item 

void ERY.AgateLib.SearchPath.Clear (  ) 

Clears all search paths from the list.

bool ERY.AgateLib.SearchPath.Contains ( string  item  ) 

Checks to see if the given path is already in the list.

Parameters:
item 
Returns:

void ERY.AgateLib.SearchPath.CopyTo ( string[]  array,
int  arrayIndex 
)

Copies the list of paths to an array.

Parameters:
array 
arrayIndex 

bool ERY.AgateLib.SearchPath.Remove ( string  item  ) 

Removes an item from the search path list.

Parameters:
item 
Returns:

IEnumerator<string> ERY.AgateLib.SearchPath.GetEnumerator (  ) 

Gets an IEnumerator<string> object for iterating through the search paths.

Returns:


Property Documentation

int ERY.AgateLib.SearchPath.Count [get]

Gets how many search paths are listed here.

string ERY.AgateLib.SearchPath.this[int index] (  )  [get, set]

Returns a search path at a given index.

Parameters:
index 
Returns:


The documentation for this class was generated from the following file:
AgateLib
Awesome Game and Tool Engine Library
SourceForge.net Logo