From b9707ce08fe65f3a1fa09f033351a32077dde906 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Sat, 22 Sep 2018 05:08:07 +0200 Subject: StreamPeer get[_utf8]_string with negative length. If the "bytes" parameter of get_string and get_utf8_string is negative, the length will be read from the stream instead. The bytes parameter has now a default (-1), allowing to use them directly as reverses of put_string and put_utf8_string . put_string was not implemented, so I implemented it to allow sending ASCII strings (which are much smaller than UTF8 ones). --- doc/classes/StreamPeer.xml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'doc/classes') diff --git a/doc/classes/StreamPeer.xml b/doc/classes/StreamPeer.xml index ebe29c7e24..74ac8a79c0 100644 --- a/doc/classes/StreamPeer.xml +++ b/doc/classes/StreamPeer.xml @@ -81,10 +81,10 @@ - + - Get a string with byte-length "bytes" from the stream. + Get a string with byte-length [code]bytes[/code] from the stream. If [code]bytes[/code] is negative (default) the length will be read from the stream using the reverse process of [method put_string]. @@ -118,10 +118,10 @@ - + - Get a utf8 string with byte-length "bytes" from the stream (this decodes the string sent as utf8). + Get a utf8 string with byte-length [code]bytes[/code] from the stream (this decodes the string sent as utf8). If [code]bytes[/code] is negative (default) the length will be read from the stream using the reverse process of [method put_utf8_string]. @@ -203,6 +203,15 @@ Send a chunk of data through the connection, if all the data could not be sent at once, only part of it will. This function returns two values, an Error code and an integer, describing how much data was actually sent. + + + + + + + Put a zero-terminated ascii string into the stream prepended by a 32 bits unsigned integer representing its size. + + @@ -245,7 +254,7 @@ - Put a zero-terminated utf8 string into the stream. + Put a zero-terminated utf8 string into the stream prepended by a 32 bits unsigned integer representing its size. -- cgit v1.2.3