Пример #1
0
 /// <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);
         }
     }
 }
Пример #2
0
        /// <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);
                }
            }
        }
Пример #3
0
        /// <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());
        }
Пример #4
0
 /// <summary>
 ///     ManifestRepository constructor.
 /// </summary>
 /// <param name="file">
 ///     Source file for saving & loading manifest state.
 /// </param>
 public ManifestRepository(File file)
 {
     _file = file ?? (File)Binary;
 }
Пример #5
0
 /// <summary>
 ///     Initc constructor.
 /// </summary>
 /// <param name="file">
 ///     Initc text file.
 /// </param>
 public Initc(File file)
 {
     _file = file;
 }
Пример #6
0
 /// <inheritdoc />
 public override void Compress(File target, Directory source)
 {
     ZipFile.CreateFromDirectory(source, target);
 }
Пример #7
0
 /// <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);
 }
Пример #8
0
        /// <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());
        }
Пример #9
0
 /// <summary>
 ///     Savegame constructor.
 /// </summary>
 /// <param name="file">
 ///     Savegame binary file.
 /// </param>
 public Savegame(File file)
 {
     _file = file;
 }