Merge pull request #81564 from aaronfranke/doc-string-byte-array

Doc: Reference String <-> PackedByteArray conversions from each other
This commit is contained in:
Rémi Verschelde 2023-09-26 13:45:02 +02:00
commit 93cf990cdb
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 10 additions and 10 deletions

View File

@ -307,31 +307,31 @@
<method name="get_string_from_ascii" qualifiers="const"> <method name="get_string_from_ascii" qualifiers="const">
<return type="String" /> <return type="String" />
<description> <description>
Converts ASCII/Latin-1 encoded array to [String]. Fast alternative to [method get_string_from_utf8] if the content is ASCII/Latin-1 only. Unlike the UTF-8 function this function maps every byte to a character in the array. Multibyte sequences will not be interpreted correctly. For parsing user input always use [method get_string_from_utf8]. Converts ASCII/Latin-1 encoded array to [String]. Fast alternative to [method get_string_from_utf8] if the content is ASCII/Latin-1 only. Unlike the UTF-8 function this function maps every byte to a character in the array. Multibyte sequences will not be interpreted correctly. For parsing user input always use [method get_string_from_utf8]. This is the inverse of [method String.to_ascii_buffer].
</description> </description>
</method> </method>
<method name="get_string_from_utf8" qualifiers="const"> <method name="get_string_from_utf8" qualifiers="const">
<return type="String" /> <return type="String" />
<description> <description>
Converts UTF-8 encoded array to [String]. Slower than [method get_string_from_ascii] but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. Returns empty string if source array is not valid UTF-8 string. Converts UTF-8 encoded array to [String]. Slower than [method get_string_from_ascii] but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. Returns empty string if source array is not valid UTF-8 string. This is the inverse of [method String.to_utf8_buffer].
</description> </description>
</method> </method>
<method name="get_string_from_utf16" qualifiers="const"> <method name="get_string_from_utf16" qualifiers="const">
<return type="String" /> <return type="String" />
<description> <description>
Converts UTF-16 encoded array to [String]. If the BOM is missing, system endianness is assumed. Returns empty string if source array is not valid UTF-16 string. Converts UTF-16 encoded array to [String]. If the BOM is missing, system endianness is assumed. Returns empty string if source array is not valid UTF-16 string. This is the inverse of [method String.to_utf16_buffer].
</description> </description>
</method> </method>
<method name="get_string_from_utf32" qualifiers="const"> <method name="get_string_from_utf32" qualifiers="const">
<return type="String" /> <return type="String" />
<description> <description>
Converts UTF-32 encoded array to [String]. System endianness is assumed. Returns empty string if source array is not valid UTF-32 string. Converts UTF-32 encoded array to [String]. System endianness is assumed. Returns empty string if source array is not valid UTF-32 string. This is the inverse of [method String.to_utf32_buffer].
</description> </description>
</method> </method>
<method name="get_string_from_wchar" qualifiers="const"> <method name="get_string_from_wchar" qualifiers="const">
<return type="String" /> <return type="String" />
<description> <description>
Converts wide character ([code]wchar_t[/code], UTF-16 on Windows, UTF-32 on other platforms) encoded array to [String]. Returns empty string if source array is not valid wide string. Converts wide character ([code]wchar_t[/code], UTF-16 on Windows, UTF-32 on other platforms) encoded array to [String]. Returns empty string if source array is not valid wide string. This is the inverse of [method String.to_wchar_buffer].
</description> </description>
</method> </method>
<method name="has" qualifiers="const"> <method name="has" qualifiers="const">

View File

@ -912,7 +912,7 @@
<method name="to_ascii_buffer" qualifiers="const"> <method name="to_ascii_buffer" qualifiers="const">
<return type="PackedByteArray" /> <return type="PackedByteArray" />
<description> <description>
Converts the string to an [url=https://en.wikipedia.org/wiki/ASCII]ASCII[/url]/Latin-1 encoded [PackedByteArray]. This method is slightly faster than [method to_utf8_buffer], but replaces all unsupported characters with spaces. Converts the string to an [url=https://en.wikipedia.org/wiki/ASCII]ASCII[/url]/Latin-1 encoded [PackedByteArray]. This method is slightly faster than [method to_utf8_buffer], but replaces all unsupported characters with spaces. This is the inverse of [method PackedByteArray.get_string_from_ascii].
</description> </description>
</method> </method>
<method name="to_camel_case" qualifiers="const"> <method name="to_camel_case" qualifiers="const">
@ -973,25 +973,25 @@
<method name="to_utf8_buffer" qualifiers="const"> <method name="to_utf8_buffer" qualifiers="const">
<return type="PackedByteArray" /> <return type="PackedByteArray" />
<description> <description>
Converts the string to a [url=https://en.wikipedia.org/wiki/UTF-8]UTF-8[/url] encoded [PackedByteArray]. This method is slightly slower than [method to_ascii_buffer], but supports all UTF-8 characters. For most cases, prefer using this method. Converts the string to a [url=https://en.wikipedia.org/wiki/UTF-8]UTF-8[/url] encoded [PackedByteArray]. This method is slightly slower than [method to_ascii_buffer], but supports all UTF-8 characters. For most cases, prefer using this method. This is the inverse of [method PackedByteArray.get_string_from_utf8].
</description> </description>
</method> </method>
<method name="to_utf16_buffer" qualifiers="const"> <method name="to_utf16_buffer" qualifiers="const">
<return type="PackedByteArray" /> <return type="PackedByteArray" />
<description> <description>
Converts the string to a [url=https://en.wikipedia.org/wiki/UTF-16]UTF-16[/url] encoded [PackedByteArray]. Converts the string to a [url=https://en.wikipedia.org/wiki/UTF-16]UTF-16[/url] encoded [PackedByteArray]. This is the inverse of [method PackedByteArray.get_string_from_utf16].
</description> </description>
</method> </method>
<method name="to_utf32_buffer" qualifiers="const"> <method name="to_utf32_buffer" qualifiers="const">
<return type="PackedByteArray" /> <return type="PackedByteArray" />
<description> <description>
Converts the string to a [url=https://en.wikipedia.org/wiki/UTF-32]UTF-32[/url] encoded [PackedByteArray]. Converts the string to a [url=https://en.wikipedia.org/wiki/UTF-32]UTF-32[/url] encoded [PackedByteArray]. This is the inverse of [method PackedByteArray.get_string_from_utf32].
</description> </description>
</method> </method>
<method name="to_wchar_buffer" qualifiers="const"> <method name="to_wchar_buffer" qualifiers="const">
<return type="PackedByteArray" /> <return type="PackedByteArray" />
<description> <description>
Converts the string to a [url=https://en.wikipedia.org/wiki/Wide_character]wide character[/url] ([code]wchar_t[/code], UTF-16 on Windows, UTF-32 on other platforms) encoded [PackedByteArray]. Converts the string to a [url=https://en.wikipedia.org/wiki/Wide_character]wide character[/url] ([code]wchar_t[/code], UTF-16 on Windows, UTF-32 on other platforms) encoded [PackedByteArray]. This is the inverse of [method PackedByteArray.get_string_from_wchar].
</description> </description>
</method> </method>
<method name="trim_prefix" qualifiers="const"> <method name="trim_prefix" qualifiers="const">