BotNavSim  v0.4.3
Mobile Robot Simulation
FileBrowser Class Reference

File browser utility class for finding files and folders. More...

Static Public Member Functions

static List< string > ListFolders (string path)
 Lists folder names in directory. More...
 
static List< string > ListFiles (string path, string pattern=null)
 Lists file names in directory. More...
 

Detailed Description

File browser utility class for finding files and folders.

Definition at line 9 of file FileBrowser.cs.

Member Function Documentation

static List<string> FileBrowser.ListFiles ( string  path,
string  pattern = null 
)
static

Lists file names in directory.

Returns
List of file names.
Parameters
pathPath to search.
patternSearch pattern (i.e. "*.xml").

Definition at line 30 of file FileBrowser.cs.

30  {
31  List<string> files = new List<string>();
32  if (pattern == null) {
33  foreach(string file in Directory.GetFiles(path))
34  files.Add(Path.GetFileName(file));
35  }
36  else {
37  foreach(string file in Directory.GetFiles(path, pattern))
38  files.Add(Path.GetFileName(file));
39  }
40  return files;
41  }

Here is the caller graph for this function:

static List<string> FileBrowser.ListFolders ( string  path)
static

Lists folder names in directory.

Returns
List of folder names.
Parameters
pathPath to search.

Definition at line 16 of file FileBrowser.cs.

16  {
17  List<string> subfolders = new List<string>();
18  foreach(string folder in Directory.GetDirectories(path)) {
19  subfolders.Add(folder);
20  }
21  return subfolders;
22  }

Here is the caller graph for this function:


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