/// <summary> /// Creates a DEFLATE archive for the provided files in source Directory at the given target. /// </summary> /// <param name="target"> /// Target archive which will contain the compressed source Directory. /// </param> /// <param name="source"> /// Source Directory on the filesystem containing the files. /// </param> /// <param name="files"> /// Files in the source Directory to compress to the target archive. /// </param> public void Compress(File target, Directory source, IEnumerable <File> files) { using (var zip = ZipFile.Open(target, ZipArchiveMode.Create)) { foreach (var file in files) { zip.CreateEntryFromFile(Path.Combine(source, file), file, Level); } } }
/// <inheritdoc /> public override void Compress(File target, Directory source, IEnumerable <File> whitelist) { using (var zip = ZipFile.Open(target, ZipArchiveMode.Create)) { const CompressionLevel level = CompressionLevel.Optimal; foreach (var file in whitelist) { zip.CreateEntryFromFile(Path.Combine(source, file), file, level); } } }
/// <summary> /// Creates a DEFLATE archive for the provided files in source Directory at the given target. /// </summary> /// <param name="target"> /// Target archive which will contain the compressed source Directory. /// </param> /// <param name="source"> /// Source Directory on the filesystem containing the files. /// </param> /// <param name="files"> /// Files in the source Directory to compress to the target archive. /// </param> public void Compress(File target, Directory source, IEnumerable <File> files) { var args = new StringBuilder($"a -tzip \"{(string) target}\" "); foreach (var file in files) { var path = Path.Combine(source, file); args.Append($"\"{path}\" "); } InvokeProcess(args.ToString()); }
/// <summary> /// ManifestRepository constructor. /// </summary> /// <param name="file"> /// Source file for saving & loading manifest state. /// </param> public ManifestRepository(File file) { _file = file ?? (File)Binary; }
/// <summary> /// Initc constructor. /// </summary> /// <param name="file"> /// Initc text file. /// </param> public Initc(File file) { _file = file; }
/// <inheritdoc /> public override void Compress(File target, Directory source) { ZipFile.CreateFromDirectory(source, target); }
/// <summary> /// Creates a DEFLATE archive for the provided source Directory at the given target. /// </summary> /// <param name="target"> /// Target archive which will contain the compressed source Directory. /// </param> /// <param name="source"> /// Source Directory on the filesystem to compress to the target archive. /// </param> public void Compress(File target, Directory source) { ZipFile.CreateFromDirectory(source, target, Level, true); }
/// <summary> /// Creates a DEFLATE archive for the provided source Directory at the given target. /// </summary> /// <param name="target"> /// Target archive which will contain the compressed source Directory. /// </param> /// <param name="source"> /// Source Directory on the filesystem to compress to the target archive. /// </param> public void Compress(File target, Directory source) { var args = new StringBuilder($"a -tzip \"{(string) target}\" \"{(string) source}\""); InvokeProcess(args.ToString()); }
/// <summary> /// Savegame constructor. /// </summary> /// <param name="file"> /// Savegame binary file. /// </param> public Savegame(File file) { _file = file; }