pssht
latest
SSH server library written in PHP
|
Public Member Functions | |
__construct ($data= '') | |
count () | |
get ($limit) | |
push ($data) | |
unget ($data) | |
Protected Member Functions | |
getDelimiter ($limit) | |
getLength ($limit) | |
Protected Attributes | |
$data | |
The buffer's current data. | |
Generic buffer.
Definition at line 17 of file Buffer.php.
fpoirotte\Pssht\Buffer::__construct | ( | $data = '' | ) |
Construct a new buffer.
string | $data | (optional) Initial data for the buffer. If omitted, the buffer is initialized empty. |
Definition at line 29 of file Buffer.php.
References fpoirotte\Pssht\Buffer\$data.
fpoirotte\Pssht\Buffer::count | ( | ) |
Return the size (in bytes) of the data currently stored in the buffer.
int | The size of the buffer's current data. |
Implements Countable.
Definition at line 45 of file Buffer.php.
fpoirotte\Pssht\Buffer::get | ( | $limit | ) |
Get limited data from the beginning of the buffer.
int | string | $limit | Either the number of bytes to retrieve from the buffer, or a string delimiter to look for. |
string | The data at the beginning of the buffer, until the given limit is reached. For string delimiters, the delimiter is part of the result. |
Definition at line 123 of file Buffer.php.
References fpoirotte\Pssht\Buffer\getDelimiter(), and fpoirotte\Pssht\Buffer\getLength().
|
protected |
Return a delimited string from the buffer.
string | $limit | Delimiter. |
string | All the data at the beginning of the buffer up to (and including) the delimiter. |
null | The given delimiter does not appear in the buffer. |
Definition at line 93 of file Buffer.php.
Referenced by fpoirotte\Pssht\Buffer\get().
|
protected |
Return a limited amount of data from the buffer.
int | $limit | Number of bytes to retrieve from the buffer. |
string | Exactly $limit bytes of data from the buffer. |
null | The buffer contains less than $limit bytes of data. |
Definition at line 63 of file Buffer.php.
Referenced by fpoirotte\Pssht\Buffer\get().
fpoirotte\Pssht\Buffer::push | ( | $data | ) |
Append data to the end of the buffer.
string | $data | Data to append. |
Buffer | Returns this buffer. |
Definition at line 164 of file Buffer.php.
References fpoirotte\Pssht\Buffer\$data.
fpoirotte\Pssht\Buffer::unget | ( | $data | ) |
Prepend data to the beginning of the buffer.
string | $data | Data to prepend. |
Buffer | Returns this buffer. |
Definition at line 145 of file Buffer.php.
References fpoirotte\Pssht\Buffer\$data.