Browse Source

Add documentation to compression functions

George Marques 8 năm trước cách đây
mục cha
commit
34b6922caa
1 tập tin đã thay đổi với 42 bổ sung0 xóa
  1. 42 0
      doc/base/classes.xml

+ 42 - 0
doc/base/classes.xml

@@ -15299,6 +15299,19 @@
 				Open the file for writing or reading, depending on the flags.
 				Open the file for writing or reading, depending on the flags.
 			</description>
 			</description>
 		</method>
 		</method>
+		<method name="open_compressed">
+			<return type="int">
+			</return>
+			<argument index="0" name="path" type="String">
+			</argument>
+			<argument index="1" name="mode_flags" type="int">
+			</argument>
+			<argument index="2" name="compression_mode" type="int" default="0">
+			</argument>
+			<description>
+				Open a compressed file for reading or writing. The compression_mode can be set as one of the COMPRESSION_* constants.
+			</description>
+		</method>
 		<method name="open_encrypted">
 		<method name="open_encrypted">
 			<return type="int">
 			<return type="int">
 			</return>
 			</return>
@@ -15445,6 +15458,15 @@
 		<constant name="WRITE_READ" value="7">
 		<constant name="WRITE_READ" value="7">
 			Open the file for reading and writing. Create it if the file not exists and truncate if it exists.
 			Open the file for reading and writing. Create it if the file not exists and truncate if it exists.
 		</constant>
 		</constant>
+		<constant name="COMPRESSION_FASTLZ" value="0">
+			Use the FastLZ compression method.
+		</constant>
+		<constant name="COMPRESSION_DEFLATE" value="1">
+			Use the Deflate compression method.
+		</constant>
+		<constant name="COMPRESSION_ZSTD" value="2">
+			Use the Zstd compression method.
+		</constant>
 	</constants>
 	</constants>
 </class>
 </class>
 <class name="FileDialog" inherits="ConfirmationDialog" category="Core">
 <class name="FileDialog" inherits="ConfirmationDialog" category="Core">
@@ -33733,6 +33755,26 @@
 				Append an [PoolByteArray] at the end of this array.
 				Append an [PoolByteArray] at the end of this array.
 			</description>
 			</description>
 		</method>
 		</method>
+		<method name="compress">
+			<return type="PoolByteArray">
+			</return>
+			<argument index="0" name="compression_mode" type="int" default="0">
+			</argument>
+			<description>
+			Returns a new [PoolByteArray] with the data compressed. The compression mode can be set using one of the COMPRESS_* constants of [File].
+			</description>
+		</method>
+		<method name="decompress">
+			<return type="PoolByteArray">
+			</return>
+			<argument index="0" name="buffer_size" type="int">
+			</argument>
+			<argument index="1" name="compression_mode" type="int" default="0">
+			</argument>
+			<description>
+			Returns a new [PoolByteArray] with the data decompressed. The buffer_size should be set as the size of the uncompressed data. The compression mode can be set using one of the COMPRESS_* constants of [File].
+			</description>
+		</method>
 		<method name="get_string_from_ascii">
 		<method name="get_string_from_ascii">
 			<return type="String">
 			<return type="String">
 			</return>
 			</return>