Marshalls
继承: Object
Data transformation (marshaling) and encoding helpers.
描述
Provides data transformation and encoding utility functions.
方法
PackedByteArray | base64_to_raw ( base64_str: String ) |
String | base64_to_utf8 ( base64_str: String ) |
Variant | base64_to_variant ( base64_str: String , allow_objects: bool = false ) |
String | raw_to_base64 ( array: PackedByteArray ) |
String | utf8_to_base64 ( utf8_str: String ) |
String | variant_to_base64 ( variant: Variant , full_objects: bool = false ) |
方法说明
PackedByteArray
base64_to_raw ( base64_str: String
)
Returns a decoded PackedByteArray
corresponding to the Base64-encoded string base64_str
.
String
base64_to_utf8 ( base64_str: String
)
Returns a decoded string corresponding to the Base64-encoded string base64_str
.
Variant
base64_to_variant ( base64_str: String
, allow_objects: bool
= false )
Returns a decoded Variant
corresponding to the Base64-encoded string base64_str
. If allow_objects
is true
, decoding objects is allowed.
Internally, this uses the same decoding mechanism as the @GlobalScope.bytes_to_var
method.
Warning: 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.
String
raw_to_base64 ( array: PackedByteArray
)
Returns a Base64-encoded string of a given PackedByteArray
.
String
utf8_to_base64 ( utf8_str: String
)
Returns a Base64-encoded string of the UTF-8 string utf8_str
.
String
variant_to_base64 ( variant: Variant
, full_objects: bool
= false )
Returns a Base64-encoded string of the Variant
variant
. If full_objects
is true
, encoding objects is allowed (and can potentially include code).
Internally, this uses the same encoding mechanism as the @GlobalScope.var_to_bytes
method.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。