Skip to content

Commit ec30171

Browse files
committed
Merge branch 'ziplib' of https://github.com/McNeight/SharpZipLib into McNeight-ziplib
# Conflicts: # samples/cs/CreateZipFile/Main.cs # samples/cs/FastZip/Main.cs # samples/cs/minibzip2/Main.cs # samples/cs/minigzip/Main.cs # samples/cs/tar/Main.cs # samples/cs/unzipfile/UnZipFile.cs # samples/cs/zipfiletest/ZipFileTest.cs # samples/vb/CreateZipFile/MainForm.vb # samples/vb/minibzip2/Main.vb # samples/vb/viewzipfile/Main.vb
2 parents c4f9491 + 38a032d commit ec30171

28 files changed

Lines changed: 159 additions & 161 deletions
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Combine fileversion="1.0" name="SharpZipLib" description="">
22
<StartMode startupentry="ICSharpCode.SharpZipLib" single="True" />
33
<Entries>
4-
<Entry filename=".\src\ICSharpCode.SharpZLib.prjx" />
4+
<Entry filename=".\src\ICSharpCode.SharpZipLib.prjx" />
55
</Entries>
66
<Configurations active="Debug">
77
<Configuration name="Release" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Microsoft Visual Studio Solution File, Format Version 9.00
44
# SharpDevelop 2.2.1.2660
55
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpZipLibTests", "tests\SharpZipLibTests.csproj", "{4F9BF21E-A7FC-4005-A1C7-A17108F7010D}"
66
EndProject
7-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpZLib", "src\ICSharpCode.SharpZLib.csproj", "{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}"
7+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpZipLib", "src\ICSharpCode.SharpZipLib.csproj", "{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}"
88
EndProject
99
Global
1010
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Microsoft Visual Studio Solution File, Format Version 9.00
44
# SharpDevelop 2.2.1.2660
55
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpZipLibTests", "tests\SharpZipLibTests.csproj", "{4F9BF21E-A7FC-4005-A1C7-A17108F7010D}"
66
EndProject
7-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpZLib", "src\ICSharpCode.SharpZLib.csproj", "{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}"
7+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpZipLib", "src\ICSharpCode.SharpZipLib.csproj", "{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}"
88
EndProject
99
Global
1010
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 10.00
33
# Visual Studio 2008
44
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpZipLibTests", "tests\SharpZipLibTests.csproj", "{4F9BF21E-A7FC-4005-A1C7-A17108F7010D}"
55
EndProject
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpZLib", "src\ICSharpCode.SharpZLib.csproj", "{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpZipLib", "src\ICSharpCode.SharpZipLib.csproj", "{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution

SharpZipAll.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 10.00
33
# Visual Studio 2008
44
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpZipLibTests", "tests\SharpZipLibTests.csproj", "{4F9BF21E-A7FC-4005-A1C7-A17108F7010D}"
55
EndProject
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpZLib", "src\ICSharpCode.SharpZLib.csproj", "{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpZipLib", "src\ICSharpCode.SharpZipLib.csproj", "{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}"
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sz", "samples\cs\sz\sz.csproj", "{CE0CEA62-CC91-4D17-BC57-A5FCACCA6A1F}"
99
EndProject

SharpZipAll2005.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 9.00
33
# Visual Studio 2005
4-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpZLib", "src\ICSharpCode.SharpZLib.csproj", "{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}"
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpZipLib", "src\ICSharpCode.SharpZipLib.csproj", "{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}"
55
EndProject
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "zf", "samples\cs\zf\zf.csproj", "{90E83588-261C-45A3-964F-4B707357D437}"
77
EndProject

SharpZipAll2008.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 10.00
33
# Visual Studio 2008
44
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpZipLibTests", "tests\SharpZipLibTests.csproj", "{4F9BF21E-A7FC-4005-A1C7-A17108F7010D}"
55
EndProject
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpZLib", "src\ICSharpCode.SharpZLib.csproj", "{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpZipLib", "src\ICSharpCode.SharpZipLib.csproj", "{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}"
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sz", "samples\cs\sz\sz.csproj", "{CE0CEA62-CC91-4D17-BC57-A5FCACCA6A1F}"
99
EndProject
File renamed without changes.

mkDistribution.bat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ if exist current (
77
mkdir current
88

99
REM mkdir current\netcf-10
10-
REM nant -t:netcf-1.0 -D:build.output.dir=current\netcf-10 -buildfile:sharpZLib.build build
10+
REM nant -t:netcf-1.0 -D:build.output.dir=current\netcf-10 -buildfile:SharpZipLib.build build
1111

1212
mkdir current\netcf-20
13-
nant -t:netcf-2.0 -D:build.output.dir=current\netcf-20 -buildfile:sharpZLib.build build
13+
nant -t:netcf-2.0 -D:build.output.dir=current\netcf-20 -buildfile:SharpZipLib.build build
1414

1515
mkdir current\net-11
16-
nant -t:net-1.1 -D:build.output.dir=current\net-11 -buildfile:sharpZLib.build build
16+
nant -t:net-1.1 -D:build.output.dir=current\net-11 -buildfile:SharpZipLib.build build
1717

1818
mkdir current\net-20
19-
nant -t:net-2.0 -D:build.output.dir=current\net-20 -buildfile:sharpZLib.build build
19+
nant -t:net-2.0 -D:build.output.dir=current\net-20 -buildfile:SharpZipLib.build build
2020

2121
@rem Version 1.8 of Sandcastle Help File Builder no longer includes the Console.exe, use the GUI instead
2222
"c:\Program Files\EWSoftware\Sandcastle Help File Builder\SandcastleBuilderConsole.exe" .\SharpZipLib.shfb

samples/cs/CreateZipFile/Main.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SharpZipLibrary samples
1+
// SharpZipLib samples
22
// Copyright © 2000-2016 AlphaSierraPapa for the SharpZipLib Team
33
// All rights reserved.
44
//
@@ -32,7 +32,7 @@
3232

3333
class MainClass
3434
{
35-
35+
3636
public static void Main(string[] args)
3737
{
3838
// Perform some simple parameter checking. More could be done
@@ -53,32 +53,32 @@ public static void Main(string[] args)
5353
// Depending on the directory this could be very large and would require more attention
5454
// in a commercial package.
5555
string[] filenames = Directory.GetFiles(args[0]);
56-
56+
5757
// 'using' statements guarantee the stream is closed properly which is a big source
5858
// of problems otherwise. Its exception safe as well which is great.
5959
using (ZipOutputStream s = new ZipOutputStream(File.Create(args[1]))) {
60-
60+
6161
s.SetLevel(9); // 0 - store only to 9 - means best compression
62-
62+
6363
byte[] buffer = new byte[4096];
64-
64+
6565
foreach (string file in filenames) {
66-
66+
6767
// Using GetFileName makes the result compatible with XP
6868
// as the resulting path is not absolute.
6969
ZipEntry entry = new ZipEntry(Path.GetFileName(file));
70-
70+
7171
// Setup the entry data as required.
72-
72+
7373
// Crc and size are handled by the library for seakable streams
7474
// so no need to do them here.
7575

7676
// Could also use the last write time or similar for the file.
7777
entry.DateTime = DateTime.Now;
7878
s.PutNextEntry(entry);
79-
79+
8080
using ( FileStream fs = File.OpenRead(file) ) {
81-
81+
8282
// Using a fixed size buffer here makes no noticeable difference for output
8383
// but keeps a lid on memory usage.
8484
int sourceBytes;
@@ -88,21 +88,21 @@ public static void Main(string[] args)
8888
} while ( sourceBytes > 0 );
8989
}
9090
}
91-
91+
9292
// Finish/Close arent needed strictly as the using statement does this automatically
93-
93+
9494
// Finish is important to ensure trailing information for a Zip file is appended. Without this
9595
// the created file would be invalid.
9696
s.Finish();
97-
97+
9898
// Close is important to wrap things up and unlock the file.
9999
s.Close();
100100
}
101101
}
102102
catch(Exception ex)
103103
{
104104
Console.WriteLine("Exception during processing {0}", ex);
105-
105+
106106
// No need to rethrow the exception as for our purposes its handled.
107107
}
108108
}

0 commit comments

Comments
 (0)