From 25199ab4c29057d7c0a73812fc8f2ac3605c1d86 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Wed, 10 Aug 2016 21:04:41 -0400 Subject: add documentation --- Zip/Archive.html | 472 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 472 insertions(+) create mode 100644 Zip/Archive.html (limited to 'Zip/Archive.html') diff --git a/Zip/Archive.html b/Zip/Archive.html new file mode 100644 index 0000000..ea6e914 --- /dev/null +++ b/Zip/Archive.html @@ -0,0 +1,472 @@ + + + + + + + + Zip::Archive - github.com/pablotron/zip-crystal + + + +
+ + + + + + +
+ +
+

+ + class Zip::Archive + +

+ + + + + + + +

Overview

+ +

Input archive.

+ +

Use Zip.read() instead of instantiating this class directly.

+ + + + + +

Included Modules

+ + + + + + + + + + + +

Defined in:

+ + + + + + +

Class Method Summary

+ + + + +

Instance Method Summary

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +

Class Method Detail

+ +
+
+ + def self.new(io : Source) + + # +
+ +

Create new Zip::Archive from input Zip::Source.

+ +

Use Zip.read() instead of calling this method directly.

+ +
+
+ +
+
+ + + + +

Instance Method Detail

+ +
+
+ + def [](path : String) : Entry + + # +
+ +

Get Zip::Entry by path.

+ +

Example:

+ +

# get bar.txt and read it into memory io +io = MemoryIO.new +zip["bar.txt"].read(io)

+ +
+
+ +
+
+ +
+
+ + def [](id : Int) : Entry + + # +
+ +

Get Zip::Entry by number.

+ +

Example:

+ +

# read third entry from archive into memory io +io = MemoryIO.new +zip[2].read(io)

+ +
+
+ +
+
+ +
+
+ + def []?(id : Int) : Entry | Nil + + # +
+ +

Get Zip::Entry by number, or nil if it doesn't exist

+ +

Example:

+ +

# read third entry from archive into memory io +if e = zip[2] +io = MemoryIO.new +e.read(io) +end

+ +
+
+ +
+
+ +
+
+ + def []?(path : String) : Entry | Nil + + # +
+ +

Return Zip::Entry from path, or nil if it doesn't exist.

+ +

Example:

+ +

# read bar.txt into memory io if it exists +if e = zip["bar.txt"]? +io = MemoryIO.new +e.read(io) +end

+ +
+
+ +
+
+ +
+
+ + def comment : String + + # +
+ +
+
+ +
+
+ +
+
+ + def each(*args, **options, &block) + + # +
+ +
+
+ +
+
+ +
+
+ + def each(*args, **options) + + # +
+ +
+
+ +
+
+ +
+
+ + def entries : Array(Zip::Entry) + + # +
+ +
+
+ +
+
+ +
+
+ + def size(*args, **options, &block) + + # +
+ +
+
+ +
+
+ +
+
+ + def size(*args, **options) + + # +
+ +
+
+ +
+
+ + + + + +
+ + + -- cgit v1.2.3