Skip to content

Commit 1cdcdf5

Browse files
committed
Documentation updates for Zip64 and unicode.
1 parent 6c6843e commit 1cdcdf5

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

src/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@
7373
[assembly: AssemblyCopyright("Copyright 2001-2007 Mike Krueger, John Reilly")]
7474
[assembly: AssemblyTrademark("Copyright 2001-2007 Mike Krueger, John Reilly")]
7575

76-
[assembly: AssemblyVersion("0.85.3.365")]
77-
[assembly: AssemblyInformationalVersionAttribute("0.85.3")]
76+
[assembly: AssemblyVersion("0.85.4.365")]
77+
[assembly: AssemblyInformationalVersionAttribute("0.85.4")]
7878

7979

8080
[assembly: CLSCompliant(true)]

src/Zip/ZipEntry.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ public bool HasCrc
286286
/// Get/Set flag indicating if entry is encrypted.
287287
/// A simple helper routine to aid interpretation of <see cref="Flags">flags</see>
288288
/// </summary>
289+
/// <remarks>This is an assistant that interprets the <see cref="Flags">flags</see> property.</remarks>
289290
public bool IsCrypted
290291
{
291292
get {
@@ -303,8 +304,9 @@ public bool IsCrypted
303304

304305
/// <summary>
305306
/// Get / set a flag indicating wether entry name and comment text are
306-
/// encoded in Unicode UTF8
307+
/// encoded in <a href="http://www.unicode.org">unicode UTF8</a>.
307308
/// </summary>
309+
/// <remarks>This is an assistant that interprets the <see cref="Flags">flags</see> property.</remarks>
308310
public bool IsUnicodeText
309311
{
310312
get {
@@ -339,6 +341,7 @@ internal byte CryptoCheckValue
339341
/// </summary>
340342
/// <remarks>
341343
/// General purpose bit flag<br/>
344+
/// <br/>
342345
/// Bit 0: If set, indicates the file is encrypted<br/>
343346
/// Bit 1-2 Only used for compression type 6 Imploding, and 8, 9 deflating<br/>
344347
/// Imploding:<br/>
@@ -358,8 +361,12 @@ internal byte CryptoCheckValue
358361
/// Bit 4: Reserved for use by PKZIP for enhanced deflating<br/>
359362
/// Bit 5: If set indicates the file contains compressed patch data<br/>
360363
/// Bit 6: If set indicates strong encryption was used.<br/>
361-
/// Bit 7-15: Unused or reserved<br/>
364+
/// Bit 7-10: Unused or reserved<br/>
365+
/// Bit 11: If set the name and comments for this entry are in <a href="http://www.unicode.org">unicode</a>.<br/>
366+
/// Bit 12-15: Unused or reserved<br/>
362367
/// </remarks>
368+
/// <seealso cref="IsUnicodeText"></seealso>
369+
/// <seealso cref="IsCrypted"></seealso>
363370
public int Flags
364371
{
365372
get {
@@ -373,6 +380,7 @@ public int Flags
373380
/// <summary>
374381
/// Get/Set index of this entry in Zip file
375382
/// </summary>
383+
/// <remarks>This is only valid when the entry is part of a <see cref="ZipFile"></see></remarks>
376384
public long ZipFileIndex
377385
{
378386
get {
@@ -741,6 +749,8 @@ public string Name
741749
/// <returns>
742750
/// The size or -1 if unknown.
743751
/// </returns>
752+
/// <remarks>Setting the size before adding an entry to an archive can help
753+
/// avoid compatability problems with some archivers which dont understand Zip64 extensions.</remarks>
744754
public long Size
745755
{
746756
get {

src/Zip/ZipOutputStream.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,14 @@ public bool IsFinished
121121
/// Set the zip file comment.
122122
/// </summary>
123123
/// <param name="comment">
124-
/// The comment string
124+
/// The comment text for the entire archive.
125125
/// </param>
126126
/// <exception name ="ArgumentOutOfRangeException">
127-
/// Encoding of comment is longer than 0xffff bytes.
127+
/// The <see cref="ZipConstants.DefaultCodePage">encoded</see> comment is longer than 0xffff bytes.
128128
/// </exception>
129129
public void SetComment(string comment)
130130
{
131+
// TODO: Its not yet clear how to handle unicode comments here.
131132
byte[] commentBytes = ZipConstants.ConvertToArray(comment);
132133
if (commentBytes.Length > 0xffff) {
133134
throw new ArgumentOutOfRangeException("comment");
@@ -161,6 +162,10 @@ public int GetLevel()
161162
/// <summary>
162163
/// Get / set a value indicating how Zip64 Extension usage is determined when adding entries.
163164
/// </summary>
165+
/// <remarks>Older archivers may not understand Zip64 extensions.
166+
/// If backwards compatability is an issue be careful when adding <see cref="ZipEntry.Size">entries</see> to an archive.
167+
/// Setting this property to off is workable but less desirable as in those circumstances adding a file
168+
/// larger then 4GB will fail.</remarks>
164169
public UseZip64 UseZip64
165170
{
166171
get { return useZip64_; }
@@ -804,6 +809,7 @@ public override void Finish()
804809
// Default is dynamic which is not backwards compatible and can cause problems
805810
// with XP's built in compression which cant read Zip64 archives.
806811
// However it does avoid the situation were a large file is added and cannot be completed correctly.
812+
// NOTE: Setting the size for entries before they are added is the best solution!
807813
UseZip64 useZip64_ = UseZip64.Dynamic;
808814
#endregion
809815
}

tests/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// You can specify all values by your own or you can build default build and revision
2424
// numbers with the '*' character (the default):
2525

26-
[assembly: AssemblyVersion("0.85.3.365")]
26+
[assembly: AssemblyVersion("0.85.4.365")]
2727

2828
// The following attributes specify the key for the sign of your assembly. See the
2929
// .NET Framework documentation for more information about signing.

0 commit comments

Comments
 (0)