From 109e58cf7529c3c172ba8fba9aba8de2e8da0015 Mon Sep 17 00:00:00 2001 From: J08nY Date: Wed, 15 Jun 2016 13:32:12 +0200 Subject: [PATCH] Classref: Added docs for StreamPeer* (#5216) (cherry picked from commit cffdc52482b12db0fec62a49680a350734cc5c6b) --- core/io/stream_peer.cpp | 1 - doc/base/classes.xml | 47 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index 2a9dff86f8a..306e7d8c9d1 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -357,7 +357,6 @@ String StreamPeer::get_string(int p_bytes){ String StreamPeer::get_utf8_string(int p_bytes){ ERR_FAIL_COND_V(p_bytes<0,String()); - ERR_FAIL_COND_V(p_bytes<0,String()); Vector buf; buf.resize(p_bytes); diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 4df05881326..ab25c18b06b 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -34532,150 +34532,175 @@ This method controls whether the position between two cached points is interpola + Return the amount of bytes this [StreamPeer] has available. + Set this [StreamPeer] to use big-endian format. Default is false. + Return whether this [StreamPeer] is using big-endian format. + Put a signed byte into the stream. + Put an unsigned byte into the stream. + Put a signed 16 bit value into the stream. + Put an unsigned 16 bit value into the stream. + Put a signed 32 bit value into the stream. + Put an unsigned 32 bit value into the stream. + Put a signed 64 bit value into the stream. + Put an unsigned 64 bit value into the stream. + Put a single-precision float into the stream. + Put a double-precision float into the stream. + Put a zero-terminated utf8 string into the stream. + Put a variable into the stream. + Get a signed byte from the stream. + Get an unsigned byte from the stream. + Get a signed 16 bit value from the stream. + Get an unsigned 16 bit value from the stream. + Get a signed 32 bit value from the stream. + Get an unsigned 32 bit value from the stream. + Get a signed 64 bit value from the stream. + Get an unsigned 16 bit value from the stream. + Get a single-precision float from the stream. + Get a double-precision float from the stream. @@ -34684,6 +34709,7 @@ This method controls whether the position between two cached points is interpola + Get a string with byte-length "bytes" from the stream. @@ -34692,12 +34718,14 @@ This method controls whether the position between two cached points is interpola + Get an utf8 string with byte-length "bytes" from the stream (this decodes the string sent as utf8). + Get a variable from the stream. @@ -34706,8 +34734,10 @@ This method controls whether the position between two cached points is interpola + SSL Stream peer. + SSL Stream peer. This object can be used to connect to SSL servers. @@ -34728,27 +34758,34 @@ This method controls whether the position between two cached points is interpola + Connect to a peer using an underlying [StreamPeer] "stream", when "validate_certs" is true, [StreamPeerSSL] will validate that the certificate presented by the peer matches the "for_hostname". + Return the status of the connection, one of STATUS_* enum. + Disconnect from host. + A status representing a [StreamPeerSSL] that is disconnected. + A status representing a [StreamPeerSSL] that is connected to a host. + An errot status that shows the peer did not present a SSL certificate and validation was requested. + An error status that shows a mismatch in the SSL certificate domain presented by the host and the domain requested for validation. @@ -34768,45 +34805,55 @@ This method controls whether the position between two cached points is interpola + Connect to the specified IP:port pair. Returns [OK] on success or [FAILED] on failure. + Return whether this peer is connected. Returns true while connecting and connected. + Return the status of the connection, one of STATUS_* enum. + Return the IP of this peer. + Return the port of this peer. + Disconnect from host. + The initial status of the [StreamPeerTCP], also the status after a disconnect. + A status representing a [StreamPeerTCP] that is connecting to a host. + A status representing a [StreamPeerTCP] that is connected to a host. + A staus representing a [StreamPeerTCP] in error state.