From a63cfd89ab6070e8c75b29535a615679552da764 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sat, 13 Aug 2016 14:31:15 -0400 Subject: update documentation --- Zip.html | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 52 insertions(+), 11 deletions(-) (limited to 'Zip.html') diff --git a/Zip.html b/Zip.html index ca16367..577be1a 100644 --- a/Zip.html +++ b/Zip.html @@ -50,9 +50,24 @@ -
  • +
  • Extra + + +
  • @@ -134,11 +149,25 @@

    Library for reading and writing zip files.

    +

    Features:

    + + + +

    non-seekable IO)

    + + + +

    TODO:

    + + +

    Examples:

    Reading from a zip file:

    -
    # create output MemoryIO
    +
    require "zip-crystal/zip"
    +
    +# create output MemoryIO
     mem_io = MemoryIO.new
     
     # read from "foo.zip"
    @@ -187,8 +216,20 @@ mem_io = MemoryIO.
           
           
         
    +      
    + EMPTY_SLICE = Bytes.new(0) +
    + +
    +

    :nodoc: +Static, zero-length Bytes used when empty buffer reference is +needed. +:nodoc:

    +
    + +
    - MAGIC = {cdr_header: 33639248_u32, cdr_footer: 101010256_u32, file_header: 67324752_u32, file_footer: 134695760_u32} + MAGIC = {cdr_header: 33639248_u32, cdr_footer: 101010256_u32, file_header: 67324752_u32, file_footer: 134695760_u32, z64_footer: 101075792_u32, z64_locator: 117853008_u32}
    @@ -234,14 +275,14 @@ mem_io = MemoryIO.
  • - .write(io : IO, pos : UInt32 = 0_u32, comment : String = "", version : Version = Version::DEFAULT, &cb : Writer -> ) : UInt32 + .write(io : IO, pos : UInt64 = 0_u64, comment : String = "", version : Version = Version::DEFAULT, &cb : Writer -> ) : UInt64

    Create a Zip::Writer for the output IO io and yield it to the given block.

  • - .write(path : String, pos : UInt32 = 0_u32, comment : String = "", version : Version = Version::DEFAULT, &cb : Writer -> ) : UInt32 + .write(path : String, pos : UInt64 = 0_u64, comment : String = "", version : Version = Version::DEFAULT, &cb : Writer -> ) : UInt64

    Create a Zip::Writer for the output file path and yield it to the given block.

    @@ -342,12 +383,12 @@ io = MemoryIO.new< -
    +
    - def self.write(io : IO, pos : UInt32 = 0_u32, comment : String = "", version : Version = Version::DEFAULT, &cb : Writer -> ) : UInt32 + def self.write(io : IO, pos : UInt64 = 0_u64, comment : String = "", version : Version = Version::DEFAULT, &cb : Writer -> ) : UInt64 - # + #

    Create a Zip::Writer for the output IO io and yield it to @@ -369,12 +410,12 @@ the given block. Returns number of bytes written.

    -
    +
    - def self.write(path : String, pos : UInt32 = 0_u32, comment : String = "", version : Version = Version::DEFAULT, &cb : Writer -> ) : UInt32 + def self.write(path : String, pos : UInt64 = 0_u64, comment : String = "", version : Version = Version::DEFAULT, &cb : Writer -> ) : UInt64 - # + #

    Create a Zip::Writer for the output file path and yield it to -- cgit v1.2.3