diff --git a/ArcFormats/ArcNEKO.cs b/ArcFormats/ArcNEKO.cs index e7dc9125..5f2bd054 100644 --- a/ArcFormats/ArcNEKO.cs +++ b/ArcFormats/ArcNEKO.cs @@ -168,21 +168,9 @@ namespace GameRes.Formats.Neko { try { - var dir = FormatCatalog.Instance.DataDirectory; - var lst_file = Path.Combine (dir, "nekopack.lst"); - if (!File.Exists (lst_file)) - return new string[0]; - using (var input = new StreamReader (lst_file)) - { - var names = new List(); - string line; - while ((line = input.ReadLine()) != null) - { - if (line.Length > 0) - names.Add (line); - } - return names.ToArray(); - } + var names = new List(); + FormatCatalog.Instance.ReadFileList ("nekopack.lst", name => names.Add (name)); + return names.ToArray(); } catch (Exception X) { diff --git a/ArcFormats/KiriKiri/CryptAlgorithms.cs b/ArcFormats/KiriKiri/CryptAlgorithms.cs index 69f697f6..1b9c83e3 100644 --- a/ArcFormats/KiriKiri/CryptAlgorithms.cs +++ b/ArcFormats/KiriKiri/CryptAlgorithms.cs @@ -1208,21 +1208,12 @@ namespace GameRes.Formats.KiriKiri void ReadNames () { - var dir = FormatCatalog.Instance.DataDirectory; - var names_file = Path.Combine (dir, FileListName); var names = new Dictionary(); try { - using (var reader = new StreamReader (names_file)) - { - for (;;) - { - var name = reader.ReadLine(); - if (null == name) - break; - names[GetNameHash (name)] = name; - } - } + FormatCatalog.Instance.ReadFileList (FileListName, name => { + names[GetNameHash (name)] = name; + }); } catch (Exception X) { diff --git a/ArcFormats/TanukiSoft/ArcTAC.cs b/ArcFormats/TanukiSoft/ArcTAC.cs index f79a030a..11800931 100644 --- a/ArcFormats/TanukiSoft/ArcTAC.cs +++ b/ArcFormats/TanukiSoft/ArcTAC.cs @@ -210,21 +210,9 @@ namespace GameRes.Formats.Tanuki { try { - var dir = FormatCatalog.Instance.DataDirectory; - var lst_file = Path.Combine (dir, ListFileName); - if (!File.Exists (lst_file)) - return new string[0]; - using (var input = new StreamReader (lst_file)) - { - var names = new List(); - string line; - while ((line = input.ReadLine()) != null) - { - if (line.Length > 0) - names.Add (line); - } - return names.ToArray(); - } + var names = new List(); + FormatCatalog.Instance.ReadFileList (ListFileName, name => names.Add (name)); + return names.ToArray(); } catch (Exception X) {