Add a code sample that extracts all files to ZIPReader documentation

Tested with various ZIP files found on the web, with a single root
folder or multiple files at its root.

Co-authored-by: Raul Santos <raulsntos@gmail.com>
This commit is contained in:
Hugo Locurcio
2024-11-16 18:00:42 +01:00
parent 0f20e67d8d
commit 4db9c112ff
3 changed files with 33 additions and 4 deletions
+3 -2
View File
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ZIPPacker" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Allows the creation of zip files.
Allows the creation of ZIP files.
</brief_description>
<description>
This class implements a writer that allows storing the multiple blobs in a zip archive.
This class implements a writer that allows storing the multiple blobs in a ZIP archive. See also [ZIPReader] and [PCKPacker].
[codeblock]
# Create a ZIP archive with a single file at its root.
func write_zip_file():
var writer = ZIPPacker.new()
var err = writer.open("user://archive.zip")