Remove unused Package.(Classic|Crc)Hashes.
This commit is contained in:
@@ -21,8 +21,6 @@ namespace OpenRA.FileSystem
|
|||||||
{
|
{
|
||||||
public sealed class BagFile : IReadOnlyPackage
|
public sealed class BagFile : IReadOnlyPackage
|
||||||
{
|
{
|
||||||
static readonly uint[] Nothing = { };
|
|
||||||
|
|
||||||
readonly string bagFilename;
|
readonly string bagFilename;
|
||||||
readonly Stream s;
|
readonly Stream s;
|
||||||
readonly int bagFilePriority;
|
readonly int bagFilePriority;
|
||||||
@@ -148,16 +146,6 @@ namespace OpenRA.FileSystem
|
|||||||
return FindMatchingHash(filename).HasValue;
|
return FindMatchingHash(filename).HasValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<uint> ClassicHashes()
|
|
||||||
{
|
|
||||||
return Nothing;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<uint> CrcHashes()
|
|
||||||
{
|
|
||||||
return index.Keys;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<string> AllFileNames()
|
public IEnumerable<string> AllFileNames()
|
||||||
{
|
{
|
||||||
var lookup = new Dictionary<uint, string>();
|
var lookup = new Dictionary<uint, string>();
|
||||||
|
|||||||
@@ -96,16 +96,6 @@ namespace OpenRA.FileSystem
|
|||||||
return entries.ContainsKey(filename);
|
return entries.ContainsKey(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<uint> ClassicHashes()
|
|
||||||
{
|
|
||||||
return entries.Keys.Select(filename => PackageEntry.HashFilename(filename, PackageHashType.Classic));
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<uint> CrcHashes()
|
|
||||||
{
|
|
||||||
return Enumerable.Empty<uint>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<string> AllFileNames()
|
public IEnumerable<string> AllFileNames()
|
||||||
{
|
{
|
||||||
return entries.Keys;
|
return entries.Keys;
|
||||||
|
|||||||
@@ -83,16 +83,6 @@ namespace OpenRA.FileSystem
|
|||||||
|
|
||||||
public int Priority { get { return 1000 + priority; } }
|
public int Priority { get { return 1000 + priority; } }
|
||||||
|
|
||||||
public IEnumerable<uint> ClassicHashes()
|
|
||||||
{
|
|
||||||
return index.Keys;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<uint> CrcHashes()
|
|
||||||
{
|
|
||||||
yield break;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
s.Dispose();
|
s.Dispose();
|
||||||
|
|||||||
@@ -43,17 +43,6 @@ namespace OpenRA.FileSystem
|
|||||||
catch { return null; }
|
catch { return null; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<uint> ClassicHashes()
|
|
||||||
{
|
|
||||||
foreach (var filename in Directory.GetFiles(path, "*", SearchOption.TopDirectoryOnly))
|
|
||||||
yield return PackageEntry.HashFilename(Path.GetFileName(filename), PackageHashType.Classic);
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<uint> CrcHashes()
|
|
||||||
{
|
|
||||||
yield break;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<string> AllFileNames()
|
public IEnumerable<string> AllFileNames()
|
||||||
{
|
{
|
||||||
foreach (var filename in Directory.GetFiles(path, "*", SearchOption.TopDirectoryOnly))
|
foreach (var filename in Directory.GetFiles(path, "*", SearchOption.TopDirectoryOnly))
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ namespace OpenRA.FileSystem
|
|||||||
{
|
{
|
||||||
Stream GetContent(string filename);
|
Stream GetContent(string filename);
|
||||||
bool Exists(string filename);
|
bool Exists(string filename);
|
||||||
IEnumerable<uint> ClassicHashes();
|
|
||||||
IEnumerable<uint> CrcHashes();
|
|
||||||
IEnumerable<string> AllFileNames();
|
IEnumerable<string> AllFileNames();
|
||||||
int Priority { get; }
|
int Priority { get; }
|
||||||
string Name { get; }
|
string Name { get; }
|
||||||
|
|||||||
@@ -451,11 +451,6 @@ namespace OpenRA.FileSystem
|
|||||||
GetContentById(index, destfile);
|
GetContentById(index, destfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<uint> ClassicHashes()
|
|
||||||
{
|
|
||||||
return fileLookup.Keys.Select(k => PackageEntry.HashFilename(k, PackageHashType.Classic));
|
|
||||||
}
|
|
||||||
|
|
||||||
public Stream GetContentById(uint index)
|
public Stream GetContentById(uint index)
|
||||||
{
|
{
|
||||||
var fileDes = fileDescriptors[index];
|
var fileDes = fileDescriptors[index];
|
||||||
@@ -507,11 +502,6 @@ namespace OpenRA.FileSystem
|
|||||||
return GetContentById(fileLookup[fileName]);
|
return GetContentById(fileLookup[fileName]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<uint> CrcHashes()
|
|
||||||
{
|
|
||||||
yield break;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<string> AllFileNames()
|
public IEnumerable<string> AllFileNames()
|
||||||
{
|
{
|
||||||
return fileLookup.Keys;
|
return fileLookup.Keys;
|
||||||
|
|||||||
@@ -122,16 +122,6 @@ namespace OpenRA.FileSystem
|
|||||||
return GetContent(PackageEntry.HashFilename(filename, PackageHashType.Classic));
|
return GetContent(PackageEntry.HashFilename(filename, PackageHashType.Classic));
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<uint> ClassicHashes()
|
|
||||||
{
|
|
||||||
return index.Keys;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<uint> CrcHashes()
|
|
||||||
{
|
|
||||||
yield break;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<string> AllFileNames()
|
public IEnumerable<string> AllFileNames()
|
||||||
{
|
{
|
||||||
return filenames;
|
return filenames;
|
||||||
@@ -145,11 +135,6 @@ namespace OpenRA.FileSystem
|
|||||||
public int Priority { get { return 2000 + priority; } }
|
public int Priority { get { return 2000 + priority; } }
|
||||||
public string Name { get { return filename; } }
|
public string Name { get { return filename; } }
|
||||||
|
|
||||||
public void Write(Dictionary<string, byte[]> contents)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException("Cannot save InstallShieldPackages.");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
s.Dispose();
|
s.Dispose();
|
||||||
|
|||||||
@@ -170,23 +170,6 @@ namespace OpenRA.FileSystem
|
|||||||
return hash.HasValue ? GetContent(hash.Value) : null;
|
return hash.HasValue ? GetContent(hash.Value) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
static readonly uint[] Nothing = { };
|
|
||||||
public IEnumerable<uint> ClassicHashes()
|
|
||||||
{
|
|
||||||
if (type == PackageHashType.Classic)
|
|
||||||
return index.Keys;
|
|
||||||
|
|
||||||
return Nothing;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<uint> CrcHashes()
|
|
||||||
{
|
|
||||||
if (type == PackageHashType.CRC32)
|
|
||||||
return index.Keys;
|
|
||||||
|
|
||||||
return Nothing;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<string> AllFileNames()
|
public IEnumerable<string> AllFileNames()
|
||||||
{
|
{
|
||||||
var lookup = new Dictionary<uint, string>();
|
var lookup = new Dictionary<uint, string>();
|
||||||
|
|||||||
@@ -70,17 +70,6 @@ namespace OpenRA.FileSystem
|
|||||||
return new MemoryStream(data);
|
return new MemoryStream(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<uint> ClassicHashes()
|
|
||||||
{
|
|
||||||
foreach (var filename in index.Keys)
|
|
||||||
yield return PackageEntry.HashFilename(filename, PackageHashType.Classic);
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<uint> CrcHashes()
|
|
||||||
{
|
|
||||||
yield break;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<string> AllFileNames()
|
public IEnumerable<string> AllFileNames()
|
||||||
{
|
{
|
||||||
foreach (var filename in index.Keys)
|
foreach (var filename in index.Keys)
|
||||||
|
|||||||
@@ -71,17 +71,6 @@ namespace OpenRA.FileSystem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<uint> ClassicHashes()
|
|
||||||
{
|
|
||||||
foreach (ZipEntry entry in pkg)
|
|
||||||
yield return PackageEntry.HashFilename(entry.Name, PackageHashType.Classic);
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<uint> CrcHashes()
|
|
||||||
{
|
|
||||||
yield break;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<string> AllFileNames()
|
public IEnumerable<string> AllFileNames()
|
||||||
{
|
{
|
||||||
foreach (ZipEntry entry in pkg)
|
foreach (ZipEntry entry in pkg)
|
||||||
|
|||||||
Reference in New Issue
Block a user