/[EmuXPortal]/trunk/EmuXPortal/Api/RomParser.cs
ViewVC logotype

Diff of /trunk/EmuXPortal/Api/RomParser.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 18 by william, Wed Apr 4 01:32:58 2012 UTC revision 26 by william, Wed Apr 4 03:37:37 2012 UTC
# Line 18  namespace EmuXPortal.Api Line 18  namespace EmuXPortal.Api
18          public List<IRomConfig> Roms { get; private set; }          public List<IRomConfig> Roms { get; private set; }
19          private List<string> GetRoms(string path, string searchPattern)          private List<string> GetRoms(string path, string searchPattern)
20          {          {
21              logger.WriteLine("Searching for Roms in Folder: {0}", path);              logger.WriteLine("Searching for Roms in Folder: {0}", path);            
22              List<string> roms = new List<string>(Directory.GetFiles(path, searchPattern));              List<string> roms = (searchPattern == "*.*")
23              foreach (string rom in roms)                  ? new List<string>(Directory.GetFiles(path, "*.*", SearchOption.AllDirectories))
24              {                  : new List<string>(Directory.GetFiles(path, "*.*", SearchOption.AllDirectories).Where(s => searchPattern.Contains(Path.GetExtension(s).ToLower())));
25                  FileInfo fi = new FileInfo(rom);              foreach (string rom in roms) { FileInfo fi = new FileInfo(rom); logger.WriteLine("\tAdding: {0}", fi.Name); }
                 logger.WriteLine("\tAdding: {0}",fi.Name);  
             }  
26              return roms;              return roms;
27          }          }
   
28          private List<IRomConfig> GenerateRomConfig(List<string> roms)          private List<IRomConfig> GenerateRomConfig(List<string> roms)
29          {          {
30              List<IRomConfig> romconfigs = new List<IRomConfig>();              List<IRomConfig> romconfigs = new List<IRomConfig>();
# Line 35  namespace EmuXPortal.Api Line 32  namespace EmuXPortal.Api
32              foreach (string rom in roms) { romconfigs.Add(RomLoader.Load(rom)); }              foreach (string rom in roms) { romconfigs.Add(RomLoader.Load(rom)); }
33              return romconfigs;              return romconfigs;
34          }          }
   
35      }      }
36  }  }

Legend:
Removed from v.18  
changed lines
  Added in v.26

  ViewVC Help
Powered by ViewVC 1.1.22