--- /dev/null
+.. index::
+ single: RingZip; はじめに
+
+==============
+RingZip の用法
+==============
+
+RingZip の用法を学びます。
+
+.. index::
+ pair: RingZip; Zip ファイルの作成
+
+Zip ファイルの作成
+==================
+
+用例 : 四本のファイルがある myfile.zip を作成します。
+
+.. code-block:: ring
+
+ load "ziplib.ring"
+ oZip = zip_openfile("myfile.zip",'w')
+ zip_addfile(oZip,"test.c")
+ zip_addfile(oZip,"zip.c")
+ zip_addfile(oZip,"zip.h")
+ zip_addfile(oZip,"miniz.h")
+ zip_close(oZip)
+
+.. index::
+ pair: RingZip; Zip ファイルの展開
+
+Zip ファイルの展開
+==================
+
+用例 : myfile.zip を myfolder フォルダへ展開します。
+
+.. code-block:: ring
+
+ load "ziplib.ring"
+ zip_extract_allfiles("myfile.zip","myfolder")
+
+.. index::
+ pair: RingZip; Zip ファイルにあるファイルのリスト表示
+
+Zip ファイルにあるファイルのリスト表示
+======================================
+
+用例 : myfile.zip にあるファイル名のリストを表示します。
+
+.. code-block:: ring
+
+ load "ziplib.ring"
+ oZip = zip_openfile("myfile.zip",'r')
+ for x=1 to zip_filescount(oZip)
+ see zip_getfilenamebyindex(oZip,x) + nl
+ next
+ zip_close(oZip)
+
+.. index::
+ pair: RingZip; RingZip クラスの用法
+
+RingZip クラスの用法
+====================
+
+RingZip ライブラリには二種類のクラスがあります。すなわち、 Zip クラスと ZipEntry クラスです。
+
+用例①:
+
+.. code-block:: ring
+
+ load "ziplib.ring"
+
+ new Zip {
+ setFileName("myfile.zip")
+ open("w")
+ newEntry() {
+ open("test.c")
+ writefile("test.c")
+ close()
+ }
+ close()
+ }
+
+用例②:
+
+.. code-block:: ring
+
+ load "ziplib.ring"
+
+ new Zip {
+ SetFileName("myfile.zip")
+ Open("w")
+ AddFile("test.c")
+ AddFile("zip.c")
+ AddFile("zip.h")
+ AddFile("miniz.h")
+ Close()
+ }
+
+
+用例③:
+
+.. code-block:: ring
+
+ load "ziplib.ring"
+
+ new zip {
+ SetFileName("myfile.zip")
+ ExtractAllFiles("myfolder")
+ }
+
+
+用例④:
+
+.. code-block:: ring
+
+ load "ziplib.ring"
+
+ new Zip {
+ SetFileName("myfile.zip")
+ Open("r")
+ see FilesCount()
+ Close()
+ }
+
+
+用例⑤:
+
+.. code-block:: ring
+
+ load "ziplib.ring"
+
+ new Zip {
+ SetFileName("myfile.zip")
+ Open("r")
+ for x = 1 to filescount()
+ See GetFileNameByIndex(x) + nl
+ next
+ Close()
+ }
+
+.. index::
+ pair: RingZip; Zip クラスリファレンス
+
+Zip クラスリファレンス
+======================
+
+メソッド:
+
+=========================== ======================================================================
+メソッド 説明・実行結果
+=========================== ======================================================================
+SetFileName(cName) Zip ファイル名を指定します。
+GetFileName() Zip ファイル名を返します。
+Open(cMode) ファイルを開きます。 cMode = “a”, “w” または “r”
+Close() Zip ファイルを閉じます。
+AddFile(cFileName) Zip ファイルへ新しいファイルを追加します。
+ExtractAllFiles(cFolder) Zip ファイルにあるファイルを全て展開します。
+FilesCount() Zip ファイルにあるファイルの本数を返します。
+GetFileNameByIndex(nIndex) ファイルインデックスから Zip ファイルのファイル名を返します。
+NewEntry() 新しい ZipEntry オブジェクトを作成します。
+=========================== ======================================================================
+
+
+.. index::
+ pair: RingZip; ZipEntry クラスリファレンス
+
+ZipEntry クラスリファレンス
+===========================
+
+メソッド:
+
+=========================== ======================================================================
+メソッド 説明・実行結果
+=========================== ======================================================================
+Open(cFileName) 新しいエントリーを開きます。
+WriteFile(cFileName) エントリーからファイルへ書き込みます。
+WriteString(cString) エントリーから文字列へ書き込みます。
+Close() エントリーを閉じます。
+=========================== ======================================================================
+
+