2017-09-13 04:42:36 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-03-01 08:44:37 +08:00
<class name= "Marshalls" inherits= "Object" version= "4.1" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-13 04:42:36 +08:00
<brief_description >
2023-01-21 19:25:29 +08:00
Data transformation (marshaling) and encoding helpers.
2017-09-13 04:42:36 +08:00
</brief_description>
<description >
2017-09-13 06:18:26 +08:00
Provides data transformation and encoding utility functions.
2017-09-13 04:42:36 +08:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "base64_to_raw" >
2021-07-30 21:28:05 +08:00
<return type= "PackedByteArray" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "base64_str" type= "String" />
2017-09-13 04:42:36 +08:00
<description >
2022-08-12 21:36:48 +08:00
Returns a decoded [PackedByteArray] corresponding to the Base64-encoded string [param base64_str].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "base64_to_utf8" >
2021-07-30 21:28:05 +08:00
<return type= "String" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "base64_str" type= "String" />
2017-09-13 04:42:36 +08:00
<description >
2022-08-12 21:36:48 +08:00
Returns a decoded string corresponding to the Base64-encoded string [param base64_str].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "base64_to_variant" >
2021-07-30 21:28:05 +08:00
<return type= "Variant" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "base64_str" type= "String" />
<param index= "1" name= "allow_objects" type= "bool" default= "false" />
2017-09-13 04:42:36 +08:00
<description >
2022-08-12 21:36:48 +08:00
Returns a decoded [Variant] corresponding to the Base64-encoded string [param base64_str]. If [param allow_objects] is [code]true[/code], decoding objects is allowed.
2023-01-18 01:42:26 +08:00
Internally, this uses the same decoding mechanism as the [method @GlobalScope.bytes_to_var] method.
2019-06-22 07:04:47 +08:00
[b]Warning:[/b] Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution.
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "raw_to_base64" >
2021-07-30 21:28:05 +08:00
<return type= "String" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "array" type= "PackedByteArray" />
2017-09-13 04:42:36 +08:00
<description >
2020-02-18 20:59:24 +08:00
Returns a Base64-encoded string of a given [PackedByteArray].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "utf8_to_base64" >
2021-07-30 21:28:05 +08:00
<return type= "String" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "utf8_str" type= "String" />
2017-09-13 04:42:36 +08:00
<description >
2022-08-12 21:36:48 +08:00
Returns a Base64-encoded string of the UTF-8 string [param utf8_str].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "variant_to_base64" >
2021-07-30 21:28:05 +08:00
<return type= "String" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "variant" type= "Variant" />
<param index= "1" name= "full_objects" type= "bool" default= "false" />
2017-09-13 04:42:36 +08:00
<description >
2022-08-12 21:36:48 +08:00
Returns a Base64-encoded string of the [Variant] [param variant]. If [param full_objects] is [code]true[/code], encoding objects is allowed (and can potentially include code).
2023-01-18 01:42:26 +08:00
Internally, this uses the same encoding mechanism as the [method @GlobalScope.var_to_bytes] method.
2017-09-13 04:42:36 +08:00
</description>
</method>
</methods>
</class>