You've already forked linux-packaging-mono
Imported Upstream version 5.4.0.167
Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
parent
e49d6f06c0
commit
536cd135cc
158
external/api-doc-tools/external/SharpZipLib/ICSharpCode.SharpZipLib.Samples/Samples.sln
vendored
Normal file
158
external/api-doc-tools/external/SharpZipLib/ICSharpCode.SharpZipLib.Samples/Samples.sln
vendored
Normal file
@@ -0,0 +1,158 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25123.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CS", "CS", "{07E37AC9-4F01-4D1D-B5CB-6524CA36D22A}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VB", "VB", "{F2D07126-17F2-4EBE-910D-B3838DA7C6D3}"
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "CreateZipFile", "vb\CreateZipFile\CreateZipFile.vbproj", "{1B2FD768-E530-45B7-B14F-AE5D07B24485}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD} = {0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "minibzip2", "vb\minibzip2\minibzip2.vbproj", "{E4AFB41C-DDBB-44AD-9D64-304B7FEE66C9}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD} = {0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ViewZipFile", "vb\viewzipfile\ViewZipFile.vbproj", "{DB53264C-64AD-4B43-91A9-F5325561C77B}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD} = {0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ZipFileTest", "vb\zipfiletest\ZipFileTest.vbproj", "{54057AFD-35E2-48C3-8419-45D57C351C1F}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD} = {0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WpfCreateZipFile", "vb\WpfCreateZipFile\WpfCreateZipFile.vbproj", "{2B42AA12-DD23-4EB8-A1CD-5D0F4B772895}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpZipLib", "..\ICSharpCode.SharpZipLib\ICSharpCode.SharpZipLib.csproj", "{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPFFolderBrowser", "..\..\wpffolderbrowser\WPFFolderBrowser.csproj", "{CE304F35-FABF-4A24-AC48-5710670A82BE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreateZipFile", "cs\CreateZipFile\CreateZipFile.csproj", "{DF63551E-BB6C-4A8D-9B01-DB94F721E74A}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FastZip", "cs\FastZip\FastZip.csproj", "{61BE8DBC-149A-4564-B891-9EEA4A09ED12}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sz", "cs\sz\sz.csproj", "{CE0CEA62-CC91-4D17-BC57-A5FCACCA6A1F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "zf", "cs\zf\zf.csproj", "{90E83588-261C-45A3-964F-4B707357D437}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnZipFile", "cs\unzipfile\UnZipFile.csproj", "{DE6AA83B-1EFA-41B0-85D9-49DA1B0202BC}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ViewZipFile", "cs\viewzipfile\ViewZipFile.csproj", "{F356B460-0DEA-4F7D-9CD8-7475B9BEC1F7}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cmd_BZip2", "cs\Cmd_BZip2\Cmd_BZip2.csproj", "{7520CE0B-F1D4-4148-8427-BB03669D7672}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cmd_GZip", "cs\Cmd_GZip\Cmd_GZip.csproj", "{301EF496-ED72-4448-A98E-A60D6BF6E0AE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cmd_Tar", "cs\Cmd_Tar\Cmd_Tar.csproj", "{12C2AD0C-B815-426D-AFF1-7787C2DCA0F0}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cmd_ZipInfo", "cs\Cmd_ZipInfo\Cmd_ZipInfo.csproj", "{4C2CF0B1-FA7B-4FB6-83BA-24A9549AAB02}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cmd_Checksum", "cs\Cmd_Checksum\Cmd_Checksum.csproj", "{82724A84-3399-4C27-91D2-2B2629B9E3F6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1B2FD768-E530-45B7-B14F-AE5D07B24485}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1B2FD768-E530-45B7-B14F-AE5D07B24485}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1B2FD768-E530-45B7-B14F-AE5D07B24485}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1B2FD768-E530-45B7-B14F-AE5D07B24485}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E4AFB41C-DDBB-44AD-9D64-304B7FEE66C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E4AFB41C-DDBB-44AD-9D64-304B7FEE66C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E4AFB41C-DDBB-44AD-9D64-304B7FEE66C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E4AFB41C-DDBB-44AD-9D64-304B7FEE66C9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DB53264C-64AD-4B43-91A9-F5325561C77B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DB53264C-64AD-4B43-91A9-F5325561C77B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DB53264C-64AD-4B43-91A9-F5325561C77B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DB53264C-64AD-4B43-91A9-F5325561C77B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{54057AFD-35E2-48C3-8419-45D57C351C1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{54057AFD-35E2-48C3-8419-45D57C351C1F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{54057AFD-35E2-48C3-8419-45D57C351C1F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{54057AFD-35E2-48C3-8419-45D57C351C1F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2B42AA12-DD23-4EB8-A1CD-5D0F4B772895}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2B42AA12-DD23-4EB8-A1CD-5D0F4B772895}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2B42AA12-DD23-4EB8-A1CD-5D0F4B772895}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2B42AA12-DD23-4EB8-A1CD-5D0F4B772895}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CE304F35-FABF-4A24-AC48-5710670A82BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CE304F35-FABF-4A24-AC48-5710670A82BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CE304F35-FABF-4A24-AC48-5710670A82BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CE304F35-FABF-4A24-AC48-5710670A82BE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DF63551E-BB6C-4A8D-9B01-DB94F721E74A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DF63551E-BB6C-4A8D-9B01-DB94F721E74A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DF63551E-BB6C-4A8D-9B01-DB94F721E74A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DF63551E-BB6C-4A8D-9B01-DB94F721E74A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{61BE8DBC-149A-4564-B891-9EEA4A09ED12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{61BE8DBC-149A-4564-B891-9EEA4A09ED12}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{61BE8DBC-149A-4564-B891-9EEA4A09ED12}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{61BE8DBC-149A-4564-B891-9EEA4A09ED12}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CE0CEA62-CC91-4D17-BC57-A5FCACCA6A1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CE0CEA62-CC91-4D17-BC57-A5FCACCA6A1F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CE0CEA62-CC91-4D17-BC57-A5FCACCA6A1F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CE0CEA62-CC91-4D17-BC57-A5FCACCA6A1F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{90E83588-261C-45A3-964F-4B707357D437}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{90E83588-261C-45A3-964F-4B707357D437}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{90E83588-261C-45A3-964F-4B707357D437}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{90E83588-261C-45A3-964F-4B707357D437}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DE6AA83B-1EFA-41B0-85D9-49DA1B0202BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DE6AA83B-1EFA-41B0-85D9-49DA1B0202BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DE6AA83B-1EFA-41B0-85D9-49DA1B0202BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DE6AA83B-1EFA-41B0-85D9-49DA1B0202BC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F356B460-0DEA-4F7D-9CD8-7475B9BEC1F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F356B460-0DEA-4F7D-9CD8-7475B9BEC1F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F356B460-0DEA-4F7D-9CD8-7475B9BEC1F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F356B460-0DEA-4F7D-9CD8-7475B9BEC1F7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7520CE0B-F1D4-4148-8427-BB03669D7672}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7520CE0B-F1D4-4148-8427-BB03669D7672}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7520CE0B-F1D4-4148-8427-BB03669D7672}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7520CE0B-F1D4-4148-8427-BB03669D7672}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{301EF496-ED72-4448-A98E-A60D6BF6E0AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{301EF496-ED72-4448-A98E-A60D6BF6E0AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{301EF496-ED72-4448-A98E-A60D6BF6E0AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{301EF496-ED72-4448-A98E-A60D6BF6E0AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{12C2AD0C-B815-426D-AFF1-7787C2DCA0F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{12C2AD0C-B815-426D-AFF1-7787C2DCA0F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{12C2AD0C-B815-426D-AFF1-7787C2DCA0F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{12C2AD0C-B815-426D-AFF1-7787C2DCA0F0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4C2CF0B1-FA7B-4FB6-83BA-24A9549AAB02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4C2CF0B1-FA7B-4FB6-83BA-24A9549AAB02}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4C2CF0B1-FA7B-4FB6-83BA-24A9549AAB02}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4C2CF0B1-FA7B-4FB6-83BA-24A9549AAB02}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{82724A84-3399-4C27-91D2-2B2629B9E3F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{82724A84-3399-4C27-91D2-2B2629B9E3F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{82724A84-3399-4C27-91D2-2B2629B9E3F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{82724A84-3399-4C27-91D2-2B2629B9E3F6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{1B2FD768-E530-45B7-B14F-AE5D07B24485} = {F2D07126-17F2-4EBE-910D-B3838DA7C6D3}
|
||||
{E4AFB41C-DDBB-44AD-9D64-304B7FEE66C9} = {F2D07126-17F2-4EBE-910D-B3838DA7C6D3}
|
||||
{DB53264C-64AD-4B43-91A9-F5325561C77B} = {F2D07126-17F2-4EBE-910D-B3838DA7C6D3}
|
||||
{54057AFD-35E2-48C3-8419-45D57C351C1F} = {F2D07126-17F2-4EBE-910D-B3838DA7C6D3}
|
||||
{2B42AA12-DD23-4EB8-A1CD-5D0F4B772895} = {F2D07126-17F2-4EBE-910D-B3838DA7C6D3}
|
||||
{DF63551E-BB6C-4A8D-9B01-DB94F721E74A} = {07E37AC9-4F01-4D1D-B5CB-6524CA36D22A}
|
||||
{61BE8DBC-149A-4564-B891-9EEA4A09ED12} = {07E37AC9-4F01-4D1D-B5CB-6524CA36D22A}
|
||||
{CE0CEA62-CC91-4D17-BC57-A5FCACCA6A1F} = {07E37AC9-4F01-4D1D-B5CB-6524CA36D22A}
|
||||
{90E83588-261C-45A3-964F-4B707357D437} = {07E37AC9-4F01-4D1D-B5CB-6524CA36D22A}
|
||||
{DE6AA83B-1EFA-41B0-85D9-49DA1B0202BC} = {07E37AC9-4F01-4D1D-B5CB-6524CA36D22A}
|
||||
{F356B460-0DEA-4F7D-9CD8-7475B9BEC1F7} = {07E37AC9-4F01-4D1D-B5CB-6524CA36D22A}
|
||||
{7520CE0B-F1D4-4148-8427-BB03669D7672} = {07E37AC9-4F01-4D1D-B5CB-6524CA36D22A}
|
||||
{301EF496-ED72-4448-A98E-A60D6BF6E0AE} = {07E37AC9-4F01-4D1D-B5CB-6524CA36D22A}
|
||||
{12C2AD0C-B815-426D-AFF1-7787C2DCA0F0} = {07E37AC9-4F01-4D1D-B5CB-6524CA36D22A}
|
||||
{4C2CF0B1-FA7B-4FB6-83BA-24A9549AAB02} = {07E37AC9-4F01-4D1D-B5CB-6524CA36D22A}
|
||||
{82724A84-3399-4C27-91D2-2B2629B9E3F6} = {07E37AC9-4F01-4D1D-B5CB-6524CA36D22A}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,185 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using ICSharpCode.SharpZipLib.BZip2;
|
||||
|
||||
class Cmd_BZip2
|
||||
{
|
||||
static void ShowHelp()
|
||||
{
|
||||
Console.Error.WriteLine("bzip2, a block-sorting file compressor.");
|
||||
Console.Error.WriteLine("Version {0} using SharpZipLib {1}",
|
||||
typeof(Cmd_BZip2).Assembly.GetName().Version,
|
||||
typeof(BZip2).Assembly.GetName().Version);
|
||||
Console.Error.WriteLine("\n usage: {0} [flags and input files in any order]\n",
|
||||
// Environment.GetCommandLineArgs()[0]
|
||||
System.AppDomain.CurrentDomain.FriendlyName);
|
||||
Console.Error.WriteLine("");
|
||||
Console.Error.WriteLine(" -h --help print this message");
|
||||
Console.Error.WriteLine(" -d --decompress force decompression");
|
||||
Console.Error.WriteLine(" -z --compress force compression");
|
||||
Console.Error.WriteLine(" -1 .. -9 set block size to 100k .. 900k");
|
||||
Console.Error.WriteLine(" --fast alias for -1");
|
||||
Console.Error.WriteLine(" --best alias for -9");
|
||||
}
|
||||
|
||||
#region Command parsing
|
||||
enum Command
|
||||
{
|
||||
Nothing,
|
||||
Help,
|
||||
Compress,
|
||||
Decompress,
|
||||
Stop,
|
||||
}
|
||||
|
||||
class ArgumentParser
|
||||
{
|
||||
public ArgumentParser(string[] args)
|
||||
{
|
||||
if (System.AppDomain.CurrentDomain.FriendlyName.Contains("bzip2")) {
|
||||
SetCommand(Command.Compress);
|
||||
} else if (System.AppDomain.CurrentDomain.FriendlyName.Contains("bunzip2")) {
|
||||
SetCommand(Command.Decompress);
|
||||
}
|
||||
|
||||
foreach (string argument in args) {
|
||||
switch (argument) {
|
||||
case "-?": // for backwards compatibility
|
||||
case "-h":
|
||||
case "--help":
|
||||
SetCommand(Command.Help);
|
||||
break;
|
||||
case "-d":
|
||||
case "--decompress":
|
||||
SetCommand(Command.Decompress);
|
||||
break;
|
||||
case "-c": // for backwards compatibility
|
||||
case "-z":
|
||||
case "--compress":
|
||||
SetCommand(Command.Compress);
|
||||
break;
|
||||
case "-1":
|
||||
case "-2":
|
||||
case "-3":
|
||||
case "-4":
|
||||
case "-5":
|
||||
case "-6":
|
||||
case "-7":
|
||||
case "-8":
|
||||
case "-9":
|
||||
SetLevel((int)argument[1] - 48);
|
||||
break;
|
||||
case "--fast":
|
||||
SetLevel(1);
|
||||
break;
|
||||
case "--best":
|
||||
SetLevel(9);
|
||||
break;
|
||||
default:
|
||||
if (argument[0] == '-') {
|
||||
Console.Error.WriteLine("Unknown argument {0}", argument);
|
||||
command_ = Command.Stop;
|
||||
} else if (file_ == null) {
|
||||
file_ = argument;
|
||||
|
||||
if (!System.IO.File.Exists(file_)) {
|
||||
Console.Error.WriteLine("File not found '{0}'", file_);
|
||||
command_ = Command.Stop;
|
||||
}
|
||||
} else {
|
||||
Console.Error.WriteLine("File has already been specified");
|
||||
command_ = Command.Stop;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (command_ == Command.Nothing) {
|
||||
if (file_ == null) {
|
||||
command_ = Command.Help;
|
||||
} else {
|
||||
command_ = Command.Compress;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetCommand(Command command)
|
||||
{
|
||||
if ((command_ != Command.Nothing) && (command_ != Command.Stop)) {
|
||||
Console.Error.WriteLine("Command already specified");
|
||||
command_ = Command.Stop;
|
||||
} else {
|
||||
command_ = command;
|
||||
}
|
||||
}
|
||||
|
||||
void SetLevel(int level)
|
||||
{
|
||||
if (level_ != 0) {
|
||||
Console.Error.WriteLine("Level already specified");
|
||||
level_ = 0;
|
||||
} else {
|
||||
level_ = level;
|
||||
}
|
||||
}
|
||||
|
||||
public string Source {
|
||||
get { return file_; }
|
||||
}
|
||||
|
||||
public string Target {
|
||||
get {
|
||||
string result;
|
||||
if (command_ == Command.Compress) {
|
||||
result = file_ + ".bz";
|
||||
} else {
|
||||
result = Path.GetFileNameWithoutExtension(file_);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public Command Command {
|
||||
get { return command_; }
|
||||
}
|
||||
|
||||
public int Level {
|
||||
get { return level_; }
|
||||
}
|
||||
|
||||
#region Instance Fields
|
||||
Command command_ = Command.Nothing;
|
||||
string file_;
|
||||
int level_;
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
if (args.Length == 0) {
|
||||
ShowHelp();
|
||||
return 1;
|
||||
}
|
||||
|
||||
var parser = new ArgumentParser(args);
|
||||
|
||||
switch (parser.Command) {
|
||||
case Command.Help:
|
||||
ShowHelp();
|
||||
break;
|
||||
|
||||
case Command.Compress:
|
||||
Console.WriteLine("Compressing {0} to {1} at level {2}", parser.Source, parser.Target, parser.Level);
|
||||
BZip2.Compress(File.OpenRead(parser.Source), File.Create(parser.Target), true, parser.Level);
|
||||
break;
|
||||
|
||||
case Command.Decompress:
|
||||
Console.WriteLine("Decompressing {0} to {1}", parser.Source, parser.Target);
|
||||
BZip2.Decompress(File.OpenRead(parser.Source), File.Create(parser.Target), true);
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" xmlns:Conversion="urn:Conversion" ToolsVersion="14.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{7520CE0B-F1D4-4148-8427-BB03669D7672}</ProjectGuid>
|
||||
<RootNamespace>ICSharpCode.SharpZipLib.Samples</RootNamespace>
|
||||
<AssemblyName>Cmd_BZip2</AssemblyName>
|
||||
<OutputType>Exe</OutputType>
|
||||
<ApplicationIcon />
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<StartupObject>Cmd_BZip2</StartupObject>
|
||||
<NoStdLib>False</NoStdLib>
|
||||
<NoConfig>False</NoConfig>
|
||||
<RunPostBuildEvent>OnSuccessfulBuild</RunPostBuildEvent>
|
||||
<PreBuildEvent />
|
||||
<PostBuildEvent>copy Cmd_BZip2.exe bzip2.exe
|
||||
copy Cmd_BZip2.exe bunzip2.exe</PostBuildEvent>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<TargetFrameworkProfile />
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<Optimize>false</Optimize>
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<DebugType>Full</DebugType>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<FileAlignment>2048</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<Optimize>True</Optimize>
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<DocumentationFile>..\bin\Cmd_BZip2.XML</DocumentationFile>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||
<FileAlignment>2048</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
|
||||
<BaseAddress>4194304</BaseAddress>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\..\GlobalAssemblyInfo.cs">
|
||||
<Link>Properties\GlobalAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Cmd_BZip2.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="readme.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ICSharpCode.SharpZipLib\ICSharpCode.SharpZipLib.csproj">
|
||||
<Project>{0e7413ff-eb9e-4714-acf2-be3a6a7b2ffd}</Project>
|
||||
<Name>ICSharpCode.SharpZipLib</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,8 @@
|
||||
using System.Reflection;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Cmd_BZip2")]
|
||||
[assembly: AssemblyDescription("bzip2 based file compression")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -0,0 +1,15 @@
|
||||
minibzip2
|
||||
---------
|
||||
|
||||
Usage:
|
||||
|
||||
|
||||
minibzip2 [filename]
|
||||
|
||||
Will create (or overwrite) a file [filename].bz2 with the bzipped
|
||||
contents of [filename]
|
||||
|
||||
minibzip2 -d [filename].bz2
|
||||
|
||||
Will create (or overwrite) a file [filename] with the bunzipped
|
||||
contents of [filename]
|
||||
@@ -0,0 +1,160 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using ICSharpCode.SharpZipLib.Checksum;
|
||||
|
||||
class Cmd_Checksum
|
||||
{
|
||||
static void ShowHelp()
|
||||
{
|
||||
Console.Error.WriteLine("Compress or uncompress FILEs (by default, compress FILES in-place).");
|
||||
Console.Error.WriteLine("Version {0} using SharpZipLib {1}",
|
||||
typeof(Cmd_Checksum).Assembly.GetName().Version,
|
||||
typeof(IChecksum).Assembly.GetName().Version);
|
||||
Console.Error.WriteLine("");
|
||||
Console.Error.WriteLine("Mandatory arguments to long options are mandatory for short options too.");
|
||||
Console.Error.WriteLine("");
|
||||
Console.Error.WriteLine(" -a, --adler decompress");
|
||||
Console.Error.WriteLine(" -b, --bzip2 give this help");
|
||||
Console.Error.WriteLine(" -c, --crc32 compress");
|
||||
Console.Error.WriteLine(" -1, --fast compress faster");
|
||||
Console.Error.WriteLine(" -9, --best compress better");
|
||||
}
|
||||
|
||||
#region Instance Fields
|
||||
private static Command command_ = Command.Nothing;
|
||||
private static string file_;
|
||||
#endregion
|
||||
|
||||
#region Command parsing
|
||||
enum Command
|
||||
{
|
||||
Nothing,
|
||||
Help,
|
||||
Adler,
|
||||
BZip2,
|
||||
Crc32,
|
||||
Stop
|
||||
}
|
||||
|
||||
class ArgumentParser
|
||||
{
|
||||
public ArgumentParser(string[] args)
|
||||
{
|
||||
foreach (string argument in args) {
|
||||
switch (argument) {
|
||||
case "-?": // for backwards compatibility
|
||||
case "-h":
|
||||
case "--help":
|
||||
SetCommand(Command.Help);
|
||||
break;
|
||||
case "--adler32":
|
||||
SetCommand(Command.Adler);
|
||||
break;
|
||||
case "--bzip2":
|
||||
SetCommand(Command.BZip2);
|
||||
break;
|
||||
case "--crc32":
|
||||
SetCommand(Command.Crc32);
|
||||
break;
|
||||
default:
|
||||
if (argument[0] == '-') {
|
||||
Console.Error.WriteLine("Unknown argument {0}", argument);
|
||||
command_ = Command.Stop;
|
||||
} else if (file_ == null) {
|
||||
file_ = argument;
|
||||
|
||||
if (!System.IO.File.Exists(file_)) {
|
||||
Console.Error.WriteLine("File not found '{0}'", file_);
|
||||
command_ = Command.Stop;
|
||||
}
|
||||
} else {
|
||||
Console.Error.WriteLine("File has already been specified");
|
||||
command_ = Command.Stop;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (command_ == Command.Nothing) {
|
||||
if (file_ == null) {
|
||||
command_ = Command.Help;
|
||||
} else {
|
||||
command_ = Command.Crc32;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetCommand(Command command)
|
||||
{
|
||||
if ((command_ != Command.Nothing) && (command_ != Command.Stop)) {
|
||||
Console.Error.WriteLine("Command already specified");
|
||||
command_ = Command.Stop;
|
||||
} else {
|
||||
command_ = command;
|
||||
}
|
||||
}
|
||||
|
||||
public string Source {
|
||||
get { return file_; }
|
||||
}
|
||||
|
||||
public Command Command {
|
||||
get { return command_; }
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
if (args.Length == 0) {
|
||||
ShowHelp();
|
||||
return 1;
|
||||
}
|
||||
|
||||
var parser = new ArgumentParser(args);
|
||||
|
||||
if (!File.Exists(file_)) {
|
||||
Console.Error.WriteLine("Cannot find file {0}", file_);
|
||||
ShowHelp();
|
||||
return 1;
|
||||
}
|
||||
|
||||
using (FileStream checksumStream = File.OpenRead(file_)) {
|
||||
|
||||
byte[] buffer = new byte[4096];
|
||||
int bytesRead;
|
||||
|
||||
switch (parser.Command) {
|
||||
case Command.Help:
|
||||
ShowHelp();
|
||||
break;
|
||||
|
||||
case Command.Crc32:
|
||||
var currentCrc = new Crc32();
|
||||
while ((bytesRead = checksumStream.Read(buffer, 0, buffer.Length)) > 0) {
|
||||
currentCrc.Update(buffer, 0, bytesRead);
|
||||
}
|
||||
Console.WriteLine("CRC32 for {0} is 0x{1:X8}", args[0], currentCrc.Value);
|
||||
break;
|
||||
|
||||
case Command.BZip2:
|
||||
var currentBZip2Crc = new BZip2Crc();
|
||||
while ((bytesRead = checksumStream.Read(buffer, 0, buffer.Length)) > 0) {
|
||||
currentBZip2Crc.Update(buffer, 0, bytesRead);
|
||||
}
|
||||
Console.WriteLine("BZip2CRC32 for {0} is 0x{1:X8}", args[0], currentBZip2Crc.Value);
|
||||
break;
|
||||
|
||||
case Command.Adler:
|
||||
var currentAdler = new Adler32();
|
||||
while ((bytesRead = checksumStream.Read(buffer, 0, buffer.Length)) > 0) {
|
||||
currentAdler.Update(buffer, 0, bytesRead);
|
||||
}
|
||||
Console.WriteLine("Adler32 for {0} is 0x{1:X8}", args[0], currentAdler.Value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" xmlns:Conversion="urn:Conversion" ToolsVersion="14.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{82724A84-3399-4C27-91D2-2B2629B9E3F6}</ProjectGuid>
|
||||
<RootNamespace>ICSharpCode.SharpZipLib.Samples</RootNamespace>
|
||||
<AssemblyName>Cmd_Checksum</AssemblyName>
|
||||
<OutputType>Exe</OutputType>
|
||||
<ApplicationIcon />
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn />
|
||||
<StartupObject>Cmd_Checksum</StartupObject>
|
||||
<NoStdLib>False</NoStdLib>
|
||||
<NoConfig>False</NoConfig>
|
||||
<RunPostBuildEvent>OnSuccessfulBuild</RunPostBuildEvent>
|
||||
<PreBuildEvent />
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<TargetFrameworkProfile />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<Optimize>false</Optimize>
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<DebugType>full</DebugType>
|
||||
<FileAlignment>2048</FileAlignment>
|
||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<Optimize>True</Optimize>
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
|
||||
<DefineConstants />
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<DocumentationFile>..\bin\Cmd_Checksum.xml</DocumentationFile>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<FileAlignment>2048</FileAlignment>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\..\GlobalAssemblyInfo.cs">
|
||||
<Link>Properties\GlobalAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Cmd_Checksum.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="readme.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ICSharpCode.SharpZipLib\ICSharpCode.SharpZipLib.csproj">
|
||||
<Project>{0e7413ff-eb9e-4714-acf2-be3a6a7b2ffd}</Project>
|
||||
<Name>ICSharpCode.SharpZipLib</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,5 @@
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyTitle("Cmd_Checksum")]
|
||||
[assembly: AssemblyDescription("file checksum generator")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>
|
||||
@@ -0,0 +1,17 @@
|
||||
minigzip
|
||||
--------
|
||||
|
||||
Usage:
|
||||
|
||||
|
||||
minigzip [filename]
|
||||
|
||||
Will create (or overwrite) a file [filename].gz with the gzipped
|
||||
contents of [filename]
|
||||
|
||||
minigzip -d [filename].gz
|
||||
|
||||
Will create (or overwrite) a file [filename] with the gunzipped
|
||||
contents of [filename]
|
||||
|
||||
|
||||
178
external/api-doc-tools/external/SharpZipLib/ICSharpCode.SharpZipLib.Samples/cs/Cmd_GZip/Cmd_GZip.cs
vendored
Normal file
178
external/api-doc-tools/external/SharpZipLib/ICSharpCode.SharpZipLib.Samples/cs/Cmd_GZip/Cmd_GZip.cs
vendored
Normal file
@@ -0,0 +1,178 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using ICSharpCode.SharpZipLib.GZip;
|
||||
|
||||
class Cmd_GZip
|
||||
{
|
||||
static void ShowHelp()
|
||||
{
|
||||
Console.Error.WriteLine("Compress or uncompress FILEs (by default, compress FILES in-place).");
|
||||
Console.Error.WriteLine("Version {0} using SharpZipLib {1}",
|
||||
typeof(Cmd_GZip).Assembly.GetName().Version,
|
||||
typeof(GZip).Assembly.GetName().Version);
|
||||
Console.Error.WriteLine("");
|
||||
Console.Error.WriteLine("Mandatory arguments to long options are mandatory for short options too.");
|
||||
Console.Error.WriteLine("");
|
||||
Console.Error.WriteLine(" -d, --decompress decompress");
|
||||
Console.Error.WriteLine(" -h, --help give this help");
|
||||
Console.Error.WriteLine(" -z, --compress compress");
|
||||
Console.Error.WriteLine(" -1, --fast compress faster");
|
||||
Console.Error.WriteLine(" -9, --best compress better");
|
||||
}
|
||||
|
||||
#region Command parsing
|
||||
enum Command
|
||||
{
|
||||
Nothing,
|
||||
Help,
|
||||
Compress,
|
||||
Decompress,
|
||||
Stop,
|
||||
}
|
||||
|
||||
class ArgumentParser
|
||||
{
|
||||
public ArgumentParser(string[] args)
|
||||
{
|
||||
foreach (string argument in args) {
|
||||
switch (argument) {
|
||||
case "-?": // for backwards compatibility
|
||||
case "-h":
|
||||
case "--help":
|
||||
SetCommand(Command.Help);
|
||||
break;
|
||||
case "-d":
|
||||
case "--decompress":
|
||||
SetCommand(Command.Decompress);
|
||||
break;
|
||||
case "-c": // for backwards compatibility
|
||||
case "-z":
|
||||
case "--compress":
|
||||
SetCommand(Command.Compress);
|
||||
break;
|
||||
case "-1":
|
||||
case "-2":
|
||||
case "-3":
|
||||
case "-4":
|
||||
case "-5":
|
||||
case "-6":
|
||||
case "-7":
|
||||
case "-8":
|
||||
case "-9":
|
||||
SetLevel((int)argument[1] - 48);
|
||||
break;
|
||||
case "--fast":
|
||||
SetLevel(1);
|
||||
break;
|
||||
case "--best":
|
||||
SetLevel(9);
|
||||
break;
|
||||
default:
|
||||
if (argument[0] == '-') {
|
||||
Console.Error.WriteLine("Unknown argument {0}", argument);
|
||||
command_ = Command.Stop;
|
||||
} else if (file_ == null) {
|
||||
file_ = argument;
|
||||
|
||||
if (!System.IO.File.Exists(file_)) {
|
||||
Console.Error.WriteLine("File not found '{0}'", file_);
|
||||
command_ = Command.Stop;
|
||||
}
|
||||
} else {
|
||||
Console.Error.WriteLine("File has already been specified");
|
||||
command_ = Command.Stop;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (command_ == Command.Nothing) {
|
||||
if (file_ == null) {
|
||||
command_ = Command.Help;
|
||||
} else {
|
||||
command_ = Command.Compress;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetCommand(Command command)
|
||||
{
|
||||
if ((command_ != Command.Nothing) && (command_ != Command.Stop)) {
|
||||
Console.Error.WriteLine("Command already specified");
|
||||
command_ = Command.Stop;
|
||||
} else {
|
||||
command_ = command;
|
||||
}
|
||||
}
|
||||
|
||||
void SetLevel(int level)
|
||||
{
|
||||
if (level_ != 0) {
|
||||
Console.Error.WriteLine("Level already specified");
|
||||
level_ = 0;
|
||||
} else {
|
||||
level_ = level;
|
||||
}
|
||||
}
|
||||
|
||||
public string Source {
|
||||
get { return file_; }
|
||||
}
|
||||
|
||||
public string Target {
|
||||
get {
|
||||
string result;
|
||||
if (command_ == Command.Compress) {
|
||||
result = file_ + ".gz";
|
||||
} else {
|
||||
result = Path.GetFileNameWithoutExtension(file_);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public Command Command {
|
||||
get { return command_; }
|
||||
}
|
||||
|
||||
public int Level {
|
||||
get { return level_; }
|
||||
}
|
||||
|
||||
#region Instance Fields
|
||||
Command command_ = Command.Nothing;
|
||||
string file_;
|
||||
int level_;
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
if (args.Length == 0) {
|
||||
ShowHelp();
|
||||
return 1;
|
||||
}
|
||||
|
||||
var parser = new ArgumentParser(args);
|
||||
|
||||
switch (parser.Command) {
|
||||
case Command.Help:
|
||||
ShowHelp();
|
||||
break;
|
||||
|
||||
case Command.Compress:
|
||||
Console.WriteLine("Compressing {0} to {1} at level {2}", parser.Source, parser.Target, parser.Level);
|
||||
GZip.Compress(File.OpenRead(parser.Source), File.Create(parser.Target), true, parser.Level);
|
||||
break;
|
||||
|
||||
case Command.Decompress:
|
||||
Console.WriteLine("Decompressing {0} to {1}", parser.Source, parser.Target);
|
||||
GZip.Decompress(File.OpenRead(parser.Source), File.Create(parser.Target), true);
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" xmlns:Conversion="urn:Conversion" ToolsVersion="14.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{301EF496-ED72-4448-A98E-A60D6BF6E0AE}</ProjectGuid>
|
||||
<RootNamespace>ICSharpCode.SharpZipLib.Samples</RootNamespace>
|
||||
<AssemblyName>Cmd_GZip</AssemblyName>
|
||||
<OutputType>Exe</OutputType>
|
||||
<ApplicationIcon />
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn />
|
||||
<StartupObject>Cmd_GZip</StartupObject>
|
||||
<NoStdLib>False</NoStdLib>
|
||||
<NoConfig>False</NoConfig>
|
||||
<RunPostBuildEvent>OnSuccessfulBuild</RunPostBuildEvent>
|
||||
<PreBuildEvent />
|
||||
<PostBuildEvent>copy Cmd_GZip.exe gzip.exe
|
||||
copy Cmd_GZip.exe gunzip.exe</PostBuildEvent>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<TargetFrameworkProfile />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<Optimize>false</Optimize>
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<DebugType>full</DebugType>
|
||||
<FileAlignment>2048</FileAlignment>
|
||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<Optimize>True</Optimize>
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
|
||||
<DefineConstants />
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<DocumentationFile>..\bin\Cmd_GZip.XML</DocumentationFile>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<FileAlignment>2048</FileAlignment>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\..\GlobalAssemblyInfo.cs">
|
||||
<Link>Properties\GlobalAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Cmd_GZip.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="readme.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ICSharpCode.SharpZipLib\ICSharpCode.SharpZipLib.csproj">
|
||||
<Project>{0e7413ff-eb9e-4714-acf2-be3a6a7b2ffd}</Project>
|
||||
<Name>ICSharpCode.SharpZipLib</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,5 @@
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyTitle("Cmd_GZip")]
|
||||
[assembly: AssemblyDescription("gzip based file compression")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>
|
||||
@@ -0,0 +1,17 @@
|
||||
minigzip
|
||||
--------
|
||||
|
||||
Usage:
|
||||
|
||||
|
||||
minigzip [filename]
|
||||
|
||||
Will create (or overwrite) a file [filename].gz with the gzipped
|
||||
contents of [filename]
|
||||
|
||||
minigzip -d [filename].gz
|
||||
|
||||
Will create (or overwrite) a file [filename] with the gunzipped
|
||||
contents of [filename]
|
||||
|
||||
|
||||
612
external/api-doc-tools/external/SharpZipLib/ICSharpCode.SharpZipLib.Samples/cs/Cmd_Tar/Cmd_Tar.cs
vendored
Normal file
612
external/api-doc-tools/external/SharpZipLib/ICSharpCode.SharpZipLib.Samples/cs/Cmd_Tar/Cmd_Tar.cs
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{12C2AD0C-B815-426D-AFF1-7787C2DCA0F0}</ProjectGuid>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputType>Exe</OutputType>
|
||||
<NoStandardLibraries>false</NoStandardLibraries>
|
||||
<AssemblyName>Tar</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<RootNamespace>ICSharpCode.SharpZipLib.Samples</RootNamespace>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<TargetFrameworkProfile />
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<DocumentationFile>bin\Debug\Tar.XML</DocumentationFile>
|
||||
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
|
||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<DocumentationFile>bin\Release\Tar.XML</DocumentationFile>
|
||||
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
|
||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>Cmd_Tar</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\..\GlobalAssemblyInfo.cs">
|
||||
<Link>Properties\GlobalAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Cmd_Tar.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ICSharpCode.SharpZipLib\ICSharpCode.SharpZipLib.csproj">
|
||||
<Project>{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}</Project>
|
||||
<Name>ICSharpCode.SharpZipLib</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio AllowExistingFolder="true" />
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Reflection;
|
||||
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly: AssemblyTitle("Tar Sharp Sample")]
|
||||
[assembly: AssemblyDescription("A simple tar application")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user