diff options
Diffstat (limited to 'Zip.html')
-rw-r--r-- | Zip.html | 32 |
1 files changed, 26 insertions, 6 deletions
@@ -85,8 +85,28 @@ </li> - <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/WriterEntry" data-name="zip::writerentry"> - <a href="Zip/WriterEntry.html">WriterEntry</a> + <li class="parent " data-id="github.com/pablotron/zip-crystal/Zip/Writers" data-name="zip::writers"> + <a href="Zip/Writers.html">Writers</a> + + <ul> + + <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/Writers/DirEntry" data-name="zip::writers::direntry"> + <a href="Zip/Writers/DirEntry.html">DirEntry</a> + + </li> + + <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/Writers/FileEntry" data-name="zip::writers::fileentry"> + <a href="Zip/Writers/FileEntry.html">FileEntry</a> + + </li> + + <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/Writers/WriterEntry" data-name="zip::writers::writerentry"> + <a href="Zip/Writers/WriterEntry.html">WriterEntry</a> + + </li> + +</ul> + </li> @@ -124,7 +144,7 @@ mem_io <span class="o">=</span> <span class="t">MemoryIO</span>.<span class="k"> <span class="c"># read from "foo.zip"</span> <span class="t">Zip</span>.read(<span class="s">"foo.zip"</span>) <span class="k">do</span> <span class="o">|</span>zip<span class="o">|</span> <span class="c"># read contents of "bar.txt" in "foo.zip" into mem_io</span> - zip[<span class="s">"bar.txt"</span>].read(mem_io) + zip[<span class="s">"bar.txt"</span>].write(mem_io) <span class="k">end</span></code></pre> <p>Writing to a zip file:</p> @@ -260,7 +280,7 @@ io <span class="o">=</span> <span class="t">MemoryIO</span>.<span class="k">new< <span class="c"># extract "bar.txt" from zip archive in Slice some_slice and</span> <span class="c"># save it to MemoryIO</span> <span class="t">Zip</span>.read(some_slice) <span class="k">do</span> <span class="o">|</span>zip<span class="o">|</span> - zip[<span class="s">"bar.txt"</span>].read(io) + zip[<span class="s">"bar.txt"</span>].write(io) <span class="k">end</span></code></pre></div> <br/> @@ -286,7 +306,7 @@ io <span class="o">=</span> <span class="t">MemoryIO</span>.<span class="k">new< <span class="c"># extract "bar.txt" from "foo.zip" and save it to MemoryIO</span> <span class="t">Zip</span>.read(<span class="s">"foo.zip"</span>) <span class="k">do</span> <span class="o">|</span>zip<span class="o">|</span> - zip[<span class="s">"bar.txt"</span>].read(io) + zip[<span class="s">"bar.txt"</span>].write(io) <span class="k">end</span></code></pre></div> <br/> @@ -313,7 +333,7 @@ io <span class="o">=</span> <span class="t">MemoryIO</span>.<span class="k">new< <span class="c"># read "bar.txt" from "foo.zip"</span> <span class="t">Zip</span>.read(<span class="t">File</span>.open(<span class="s">"foo.zip"</span>, <span class="s">"rb"</span>)) <span class="k">do</span> <span class="o">|</span>zip<span class="o">|</span> - zip[<span class="s">"bar.txt"</span>].read(io) + zip[<span class="s">"bar.txt"</span>].write(io) <span class="k">end</span></code></pre></div> <br/> |