Class PackSource¶
Namespace: Apogee.Content.Packs
Assembly: Apogee.Content.dll
A pack (see name_001.pack…, which must all be there); files are read, decrypted, decompressed and checked against their hashes when asked for. A pack that is encrypted needs the key
(without one, or with a wrong one,
public sealed class PackSource : IFileSource, IDisposable
Inheritance¶
Implements¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Properties¶
Description¶
What the source is, for messages: a folder's path, a zip's file name.
public string Description { get; }
Property Value¶
FileCount¶
The number of files (not counting removals).
public int FileCount { get; }
Property Value¶
IsEncrypted¶
True when the pack's index is encrypted.
public bool IsEncrypted { get; }
Property Value¶
PartCount¶
The number of parts the pack is in.
public int PartCount { get; }
Property Value¶
Methods¶
Dispose()¶
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Kind(string)¶
public FileKind Kind(string path)
Parameters¶
path string
Returns¶
List(string, List<(string Name, FileKind Kind)>)¶
Adds the entries directly inside directory to into: their names and kinds, in any order (a source may list
public void List(string directory, List<(string Name, FileKind Kind)> into)
Parameters¶
directory string
into List<(string Name, FileKind Kind)>
Open(string, PackKey?)¶
Opens the pack whose first part is path, and the parts after it.
public static PackSource Open(string path, PackKey? key = null)
Parameters¶
path string
key PackKey?
The key of an encrypted pack; ignored for one that is not.
Returns¶
Exceptions¶
It is not a pack, a part is missing, it is encrypted and the key is missing or wrong, or it is damaged.
OpenRead(string)¶
A file that is neither compressed nor encrypted is streamed from the pack without being read whole (and without its hash checked); any other is read whole.
public Stream OpenRead(string path)
Parameters¶
path string
Returns¶
ReadAllBytes(string)¶
public byte[] ReadAllBytes(string path)
Parameters¶
path string
Returns¶
byte[]
Exceptions¶
There is no such file.