/[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 29 by william, Wed Apr 4 04:13:17 2012 UTC revision 38 by william, Wed Apr 4 07:22:40 2012 UTC
# Line 1  Line 1 
1  ´╗┐using System;  ´╗┐//#define LIST_ADDED_ROMS // when defined will log all found rom files
2    using System;
3  using System.Collections.Generic;  using System.Collections.Generic;
4  using System.Linq;  using System.Linq;
5  using System.Text;  using System.Text;
6  using EmuXPortal.Logging;  using EmuXPortal.Logging;
7  using System.IO;  using System.IO;
8    using System.Diagnostics;
9    
10  namespace EmuXPortal.Api  namespace EmuXPortal.Api
11  {  {
# Line 18  namespace EmuXPortal.Api Line 20  namespace EmuXPortal.Api
20          public List<IRomConfig> Roms { get; private set; }          public List<IRomConfig> Roms { get; private set; }
21          private List<string> GetRoms(string path, string searchPattern)          private List<string> GetRoms(string path, string searchPattern)
22          {          {
23              logger.WriteLine("Searching for Roms in Folder: {0}", path);                          logger.WriteLine("Searching for Roms in Folder: {0}", path);
24              List<string> roms = (searchPattern == "*.*")              List<string> roms = (searchPattern == "*.*")
25                  ? new List<string>(Directory.GetFiles(path, "*.*", SearchOption.AllDirectories))                  ? new List<string>(Directory.GetFiles(path, "*.*", SearchOption.AllDirectories))
26                  : new List<string>(Directory.GetFiles(path, "*.*", SearchOption.AllDirectories).Where(s => searchPattern.Contains(Path.GetExtension(s).ToLower())));                  : new List<string>(Directory.GetFiles(path, "*.*", SearchOption.AllDirectories).Where(s => searchPattern.Contains(Path.GetExtension(s).ToLower())));
27              foreach (string rom in roms) { FileInfo fi = new FileInfo(rom); logger.WriteLine("\tAdding: {0}", fi.Name); }              #region LIST_ADDED_ROMS
28    #if LIST_ADDED_ROMS
29                foreach (string rom in roms)
30                {
31                    FileInfo fi = new FileInfo(rom);
32                    logger.WriteLine("\tAdding: {0}", fi.Name);
33                }
34    #endif
35                #endregion
36              return roms;              return roms;
37          }          }
38          private List<IRomConfig> GenerateRomConfig(List<string> roms, IEmuConfig config)          private List<IRomConfig> GenerateRomConfig(List<string> roms, IEmuConfig config)

Legend:
Removed from v.29  
changed lines
  Added in v.38

  ViewVC Help
Powered by ViewVC 1.1.22