add some helpful overloads to HawkFile for working with known filenames, instead of just extension lists
This commit is contained in:
parent
1e6a9415c1
commit
05f1608de5
|
@ -207,6 +207,35 @@ namespace BizHawk.MultiClient
|
|||
return fn.Replace('\\', '/');
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// binds the specified ArchiveItem which you should have gotten by interrogating an archive hawkfile
|
||||
/// </summary>
|
||||
public HawkFile BindArchiveMember(ArchiveItem item)
|
||||
{
|
||||
return BindArchiveMember(item.index);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// finds an ArchiveItem with the specified name (path) within the archive; returns null if it doesnt exist
|
||||
/// </summary>
|
||||
public ArchiveItem FindArchiveMember(string name)
|
||||
{
|
||||
foreach (var ai in ArchiveItems)
|
||||
if (ai.name == name)
|
||||
return ai;
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// binds a path within the archive; returns null if that path didnt exist.
|
||||
/// </summary>
|
||||
public HawkFile BindArchiveMember(string name)
|
||||
{
|
||||
var ai = FindArchiveMember(name);
|
||||
if (ai == null) return null;
|
||||
else return BindArchiveMember(ai);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// binds the selected archive index
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue