class-description NEWS COMMUNITY STORE TUTORIALS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE TUTORIALS TOGGLE FULLSCREEN VOLLBILD AN/AUS ObjectRefCounted ZIPPacker
Allows the creation of ZIP files.

This class implements a writer that allows storing the multiple blobs in a ZIP archive. See also ZIPReader and PCKPacker.

# 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") if err != OK: return err writer.start_file("hello.txt") writer.write_file("Hello World".to_utf8_buffer()) writer.close_file() writer.close() return OK
Enum ZipAppend<>():Enum

APPEND_CREATE = 0

Create a new zip archive at the given path.


APPEND_CREATEAFTER = 1

Append a new zip archive to the end of the already existing file at the given path.


APPEND_ADDINZIP = 2

Add new files to the existing zip archive at the given path.

Error close<>():Error

Closes the underlying resources used by this instance.

Error close_file<>():Error

Stops writing to a file within the archive.

It will fail if there is no open file.

Error open<>( String path=, path:String=, ZipAppend append=0, append:ZipAppend=0, ):Error

Opens a zip file for writing at the given path using the specified write mode.

This must be called before everything else.

Error start_file<>( String path=, path:String=, ):Error

Starts writing to a file within the archive. Only one file can be written at the same time.

Must be called after open().

Error write_file<>( PackedByteArray data=, data:PackedByteArray=, ):Error

Write the given data to the file.

Needs to be called after start_file().




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...