mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 03:44:13 +08:00
use string.EndsWith() method instead of Path.GetExtension()
This commit is contained in:
parent
8640e34c27
commit
a2051e6752
@ -240,8 +240,7 @@ namespace GameRes.Formats
|
||||
int update_count = 0;
|
||||
foreach (var entry in list)
|
||||
{
|
||||
string ext = Path.GetExtension (entry.Name).ToLower();
|
||||
if (entry.Type != "image" && ext != ".scr")
|
||||
if (entry.Type != "image" && !entry.Name.EndsWith (".scr", StringComparison.InvariantCultureIgnoreCase))
|
||||
continue;
|
||||
uint id;
|
||||
if (!uint.TryParse (Path.GetFileNameWithoutExtension (entry.Name), NumberStyles.HexNumber,
|
||||
|
@ -89,7 +89,7 @@ namespace GameRes.Formats.AZSys
|
||||
public override Stream OpenEntry (ArcFile arc, Entry entry)
|
||||
{
|
||||
if (entry.Size < 20
|
||||
|| ".asb" != Path.GetExtension (entry.Name).ToLowerInvariant()
|
||||
|| !entry.Name.EndsWith (".asb", StringComparison.InvariantCultureIgnoreCase)
|
||||
|| !arc.File.View.AsciiEqual (entry.Offset, "ASB\x1a"))
|
||||
return arc.File.CreateStream (entry.Offset, entry.Size);
|
||||
uint packed = arc.File.View.ReadUInt32 (entry.Offset+4);
|
||||
|
@ -76,7 +76,7 @@ namespace GameRes.Formats.Ffa
|
||||
public override Stream OpenEntry (ArcFile arc, Entry entry)
|
||||
{
|
||||
var input = arc.File.CreateStream (entry.Offset, entry.Size);
|
||||
if (entry.Size <= 8 || Path.GetExtension (entry.Name).ToLowerInvariant() != ".so4")
|
||||
if (entry.Size <= 8 || !entry.Name.EndsWith (".so4", StringComparison.InvariantCultureIgnoreCase))
|
||||
return input;
|
||||
using (var header = new ArcView.Reader (input))
|
||||
{
|
||||
|
@ -296,8 +296,7 @@ namespace GameRes.Formats.ONScripter
|
||||
var header_entry = new NsaEntry { Name = entry.Name };
|
||||
if (Compression.None != ons_options.CompressionType)
|
||||
{
|
||||
string ext = Path.GetExtension (entry.Name).ToLower();
|
||||
if (".bmp" == ext)
|
||||
if (entry.Name.EndsWith (".bmp", StringComparison.InvariantCultureIgnoreCase))
|
||||
header_entry.CompressionType = ons_options.CompressionType;
|
||||
}
|
||||
index_size += 13;
|
||||
|
@ -76,7 +76,7 @@ namespace GameRes.Formats.Fs
|
||||
entry.Size = file.View.ReadUInt32 (cur_offset+0x88);
|
||||
if (!entry.CheckPlacement (file.MaxOffset))
|
||||
return null;
|
||||
if (Path.GetExtension (name).Equals (".dsf", System.StringComparison.OrdinalIgnoreCase))
|
||||
if (name.EndsWith (".dsf", System.StringComparison.InvariantCultureIgnoreCase))
|
||||
entry.Type = "script";
|
||||
dir.Add (entry);
|
||||
cur_offset += 0x90;
|
||||
|
@ -610,8 +610,7 @@ NextEntry:
|
||||
{
|
||||
if ("image" == entry.Type || "archive" == entry.Type)
|
||||
return false;
|
||||
var ext = Path.GetExtension (entry.Name);
|
||||
if (!string.IsNullOrEmpty (ext) && ext.Equals (".ogg", StringComparison.OrdinalIgnoreCase))
|
||||
if (entry.Name.EndsWith (".ogg", StringComparison.InvariantCultureIgnoreCase))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user