diff options
Diffstat (limited to 'Zip/Writer.html')
-rw-r--r-- | Zip/Writer.html | 63 |
1 files changed, 61 insertions, 2 deletions
diff --git a/Zip/Writer.html b/Zip/Writer.html index 894055d..0b4a935 100644 --- a/Zip/Writer.html +++ b/Zip/Writer.html @@ -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> @@ -112,6 +132,13 @@ + <h2>Overview</h2> + + <p>Zip file writer.</p> + +<p>You shouldn't need to instantiate this class directly; use +<code><a href="../Zip.html#write%28io%3AIO%2Cpos%3AUInt32%3D%3Cspanclass%3D%22n%22%3E0_u32%3C%2Fspan%3E%2Ccomment%3AString%3D%3Cspanclass%3D%22s%22%3E%26quot%3B%26quot%3B%3C%2Fspan%3E%2Cversion%3AVersion%3D%3Cspanclass%3D%22t%22%3EVersion%3C%2Fspan%3E%3Cspanclass%3D%22t%22%3E%3A%3A%3C%2Fspan%3E%3Cspanclass%3D%22t%22%3EDEFAULT%3C%2Fspan%3E%2C%26cb%3AWriter-%3E%29%3AUInt32-class-method">Zip.write</a>()</code> instead.</p> + @@ -164,6 +191,13 @@ </li> <li class="entry-summary"> + <a href="#add_dir%28path%3AString%2Ctime%3ATime%3D%3Cspanclass%3D%22t%22%3ETime%3C%2Fspan%3E.now%2Ccomment%3AString%3D%3Cspanclass%3D%22s%22%3E%26quot%3B%26quot%3B%3C%2Fspan%3E%29%3AUInt32-instance-method" class="signature"><strong>#add_dir</strong>(path : String, time : Time = <span class="t">Time</span>.now, comment : String = <span class="s">""</span>) : UInt32</a> + + <div class="summary"><p>Add empty directory to archive as <em>path</em> and return number of bytes written.</p></div> + + </li> + + <li class="entry-summary"> <a href="#add_file%28path%3AString%2Cfile_path%3AString%2Cmethod%3ACompressionMethod%3D%3Cspanclass%3D%22t%22%3ECompressionMethod%3C%2Fspan%3E%3Cspanclass%3D%22t%22%3E%3A%3A%3C%2Fspan%3E%3Cspanclass%3D%22t%22%3EDEFLATE%3C%2Fspan%3E%2Ctime%3ATime%3D%3Cspanclass%3D%22t%22%3ETime%3C%2Fspan%3E.now%2Ccomment%3AString%3D%3Cspanclass%3D%22s%22%3E%26quot%3B%26quot%3B%3C%2Fspan%3E%29%3AUInt32-instance-method" class="signature"><strong>#add_file</strong>(path : String, file_path : String, method : CompressionMethod = <span class="t">CompressionMethod</span><span class="t">::</span><span class="t">DEFLATE</span>, time : Time = <span class="t">Time</span>.now, comment : String = <span class="s">""</span>) : UInt32</a> <div class="summary"><p>Add local file <em>file_path</em> to archive as <em>path</em> and return number of bytes written.</p></div> @@ -295,6 +329,31 @@ written.</p> </div> </div> + <div class="entry-detail" id="add_dir(path:String,time:Time=<spanclass="t">Time</span>.now,comment:String=<spanclass="s">&quot;&quot;</span>):UInt32-instance-method"> + <div class="signature"> + + def <strong>add_dir</strong>(path : String, time : Time = <span class="t">Time</span>.now, comment : String = <span class="s">""</span>) : UInt32 + + <a class="method-permalink" href="#add_dir%28path%3AString%2Ctime%3ATime%3D%3Cspanclass%3D%22t%22%3ETime%3C%2Fspan%3E.now%2Ccomment%3AString%3D%3Cspanclass%3D%22s%22%3E%26quot%3B%26quot%3B%3C%2Fspan%3E%29%3AUInt32-instance-method">#</a> + </div> + + <div class="doc"><p>Add empty directory to archive as <em>path</em> and return number of +bytes written.</p> + +<p>Example:</p> + +<pre><code><span class="c"># write to "foo.zip"</span> +<span class="t">Zip</span>.write(<span class="s">"foo.zip"</span>) <span class="k">do</span> <span class="o">|</span>zip<span class="o">|</span> + <span class="c"># add a directory named "example-dir"</span> + zip.add_dir(<span class="s">"example-dir"</span>) +<span class="k">end</span></code></pre></div> + + <br/> + <div> + + </div> + </div> + <div class="entry-detail" id="add_file(path:String,file_path:String,method:CompressionMethod=<spanclass="t">CompressionMethod</span><spanclass="t">::</span><spanclass="t">DEFLATE</span>,time:Time=<spanclass="t">Time</span>.now,comment:String=<spanclass="s">&quot;&quot;</span>):UInt32-instance-method"> <div class="signature"> |