diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2015-11-24 08:36:12 +0100 |
---|---|---|
committer | Rémi Verschelde <remi@verschelde.fr> | 2015-11-24 08:36:12 +0100 |
commit | 14145d516e2e2f6f7221c691bfdedcc34b71f28e (patch) | |
tree | 6e086cc1360a4b20c66a7176fcffd933845a8c7e | |
parent | 1ac7d4fc77e6157a8db78aa3c9f82342f72c5bb7 (diff) | |
parent | 323938cc28cede46092bf5adecbd28206ee71481 (diff) |
Merge pull request #2898 from est31/string_byte_format_doc
Document string <-> byte conversion methods
-rw-r--r-- | core/variant_call.cpp | 4 | ||||
-rw-r--r-- | doc/base/classes.xml | 18 |
2 files changed, 13 insertions, 9 deletions
diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 51d683f1fe..48c38f05f9 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -1291,8 +1291,8 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC1(STRING,STRING,String,pad_decimals,INT,"digits",varray()); ADDFUNC1(STRING,STRING,String,pad_zeros,INT,"digits",varray()); - ADDFUNC0(STRING,STRING,String,to_ascii,varray()); - ADDFUNC0(STRING,STRING,String,to_utf8,varray()); + ADDFUNC0(STRING,RAW_ARRAY,String,to_ascii,varray()); + ADDFUNC0(STRING,RAW_ARRAY,String,to_utf8,varray()); ADDFUNC0(VECTOR2,VECTOR2,Vector2,normalized,varray()); diff --git a/doc/base/classes.xml b/doc/base/classes.xml index aa310b15c9..12f9062888 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -12551,7 +12551,7 @@ This approximation makes straight segments between each point, then subdivides t <description> Connect to a host. This needs to be done before any requests are sent. The host should not have http:// prepended but will strip the protocol identifier if provided. - + verify_host will check the SSL identity of the host if set to true. </description> </method> @@ -12576,9 +12576,9 @@ verify_host will check the SSL identity of the host if set to true. Sends a request to the connected host. The url is the what is normally behind the hostname, i.e: http://somehost.com/index.php url would be "index.php" - + Headers are HTTP request headers - + To create a POST request with query strings to push to the server, do: var fields = {"username" : "user", "password" : "pass"} @@ -12693,10 +12693,10 @@ var result = httpClient.request(httpClient.METHOD_POST, "index.php", headers, qu </argument> <description> Generates a GET/POST application/x-www-form-urlencoded style query string from a provided dictionary. - + var fields = {"username": "user", "password": "pass"} String queryString = httpClient.query_string_from_dict(fields) - + returns:= "username=user&password=pass" </description> </method> @@ -26372,12 +26372,14 @@ This method controls whether the position between two cached points is interpola <return type="String"> </return> <description> + Returns a copy of the array's contents formatted as String. Fast alternative to get_string_from_utf8(), assuming the content is ASCII-only (unlike the UTF-8 function, this function maps every byte to a character in the string, so any multibyte sequence will be torn apart). </description> </method> <method name="get_string_from_utf8"> <return type="String"> </return> <description> + Returns a copy of the array's contents formatted as String, assuming the array is formatted as UTF-8. Slower than get_string_from_ascii(), but works for UTF-8. Usually you should prefer this function over get_string_from_ascii() to support international input. </description> </method> <method name="push_back"> @@ -33134,9 +33136,10 @@ This method controls whether the position between two cached points is interpola </description> </method> <method name="to_ascii"> - <return type="String"> + <return type="RawArray"> </return> <description> + Convert the String (which is a character array) to RawArray (which is an array of bytes). The conversion is speeded up in comparison to to_utf8() with the assumption that all the characters the String contains are only ASCII characters. </description> </method> <method name="to_float"> @@ -33168,9 +33171,10 @@ This method controls whether the position between two cached points is interpola </description> </method> <method name="to_utf8"> - <return type="String"> + <return type="RawArray"> </return> <description> + Convert the String (which is an array of characters) to RawArray (which is an array of bytes). The conversion is a bit slower than to_ascii(), but supports all UTF-8 characters. Therefore, you should prefer this function over to_ascii(). </description> </method> <method name="xml_escape"> |