mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-09-22 06:45:03 +00:00
Convert a few more path checks
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using BurnOutSharp.Matching;
|
||||
|
||||
namespace BurnOutSharp.ProtectionType
|
||||
{
|
||||
@@ -10,19 +8,24 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("bitpool.rsc", StringComparison.OrdinalIgnoreCase)))
|
||||
return "Bitpool";
|
||||
var matchers = new List<PathMatchSet>
|
||||
{
|
||||
new PathMatchSet(new PathMatch("bitpool.rsc", useEndsWith: true), "Bitpool"),
|
||||
};
|
||||
|
||||
return null;
|
||||
var matches = MatchUtil.GetAllMatches(files, matchers, any: true);
|
||||
return string.Join(", ", matches);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("bitpool.rsc", StringComparison.OrdinalIgnoreCase))
|
||||
return "Bitpool";
|
||||
|
||||
return null;
|
||||
var matchers = new List<PathMatchSet>
|
||||
{
|
||||
new PathMatchSet(new PathMatch("bitpool.rsc", useEndsWith: true), "Bitpool"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstMatch(path, matchers, any: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user