IO Buffer class.
More...
#include <IoBuffer.h>
| esnlib::IoBuffer::IoBuffer |
( |
const char * |
buf, |
|
|
int |
bufsize |
|
) |
| |
Constructor function
- Parameters
-
| buf | The raw buffer pointer |
| bufsize | The raw buffer size |
| esnlib::IoBuffer::IoBuffer |
( |
int |
size | ) |
|
|
explicit |
Constructor function
- Parameters
-
| esnlib::IoBuffer::IoBuffer |
( |
const IoBuffer & |
src | ) |
|
|
explicit |
Constructor function
- Parameters
-
| src | The other buffer whose content will be copied |
| bool esnlib::IoBuffer::anysize |
( |
| ) |
const |
Check whether the buffer size is specific
- Returns
- Return false if the buffer size is specific
| int esnlib::IoBuffer::code |
( |
| ) |
const |
Get the buffer code
- Returns
- The buffer code
| void esnlib::IoBuffer::code |
( |
int |
value | ) |
|
Set the buffer code
- Parameters
-
| const char* esnlib::IoBuffer::data |
( |
| ) |
const |
Get the raw buffer
- Returns
- The pointer of the raw buffer
| char* esnlib::IoBuffer::data |
( |
| ) |
|
Get the raw buffer
- Returns
- The pointer of the raw buffer
| int esnlib::IoBuffer::flag |
( |
| ) |
const |
Get the buffer flag
- Returns
- The buffer flag
| void esnlib::IoBuffer::flag |
( |
int |
value | ) |
|
Set the buffer flag
- Parameters
-
| int esnlib::IoBuffer::GetBuf |
( |
char * |
buf, |
|
|
int |
len |
|
) |
| |
Read bytes at current read position from the raw buffer
- Parameters
-
| buf | The other buffer used to save the bytes |
| len | How many bytes you want to read |
- Returns
- The total number of the bytes read
| char esnlib::IoBuffer::GetByte |
( |
| ) |
|
Read a byte value at current read position from the raw buffer
- Returns
- The byte value
| double esnlib::IoBuffer::GetDouble |
( |
| ) |
|
Read a double value at current read position from the raw buffer
- Returns
- The double value
| int esnlib::IoBuffer::GetInt |
( |
| ) |
|
Read an integer value at current read position from the raw buffer
- Returns
- The integer value
| int esnlib::IoBuffer::GetReadPos |
( |
| ) |
|
Get the read position
- Returns
- The read position
| short esnlib::IoBuffer::GetShort |
( |
| ) |
|
Read a short value at current read position from the raw buffer
- Returns
- The short value
| std::string esnlib::IoBuffer::GetStr |
( |
int |
len | ) |
|
Read a string value at current read position from the raw buffer
- Parameters
-
| len | The length of the string |
- Returns
- The string value
| int esnlib::IoBuffer::GetWritePos |
( |
| ) |
|
Get the write position
- Returns
- The write position
| void esnlib::IoBuffer::PutBuf |
( |
char * |
buf, |
|
|
int |
len |
|
) |
| |
Write bytes into the raw buffer (at current write position)
- Parameters
-
| buf | The pointer of the bytes |
| len | How many bytes |
| void esnlib::IoBuffer::PutByte |
( |
char |
value | ) |
|
Write a byte value into the raw buffer (at current write position)
- Parameters
-
| void esnlib::IoBuffer::PutDouble |
( |
double |
value | ) |
|
Write a double value into the raw buffer (at current write position)
- Parameters
-
| void esnlib::IoBuffer::PutInt |
( |
int |
value | ) |
|
Write an integer value into the raw buffer (at current write position)
- Parameters
-
| void esnlib::IoBuffer::PutShort |
( |
int |
value | ) |
|
Write a short value into the raw buffer (at current write position)
- Parameters
-
| void esnlib::IoBuffer::PutStr |
( |
const std::string & |
value | ) |
|
Write a string value into the raw buffer (at current write position)
- Parameters
-
| SessionPtr esnlib::IoBuffer::session |
( |
| ) |
|
Get the session
- Returns
- The pointer of the session
| void esnlib::IoBuffer::session |
( |
SessionPtr |
value | ) |
|
Set the session
- Parameters
-
| value | The pointer of the session |
| void esnlib::IoBuffer::SetReadPos |
( |
int |
pos | ) |
|
Set the read position
- Parameters
-
| void esnlib::IoBuffer::SetWritePos |
( |
int |
pos | ) |
|
Set the write position
- Parameters
-
| int esnlib::IoBuffer::size |
( |
| ) |
const |
Get the buffer size
- Returns
- The buffer size
| int esnlib::IoBuffer::size |
( |
int |
value | ) |
|
Set the buffer size
- Parameters
-
| value | The new buffer size we ask for |
- Returns
- The actual buffer size got finally
| int esnlib::IoBuffer::state |
( |
| ) |
const |
Get the buffer state
- Returns
- The buffer state
| void esnlib::IoBuffer::state |
( |
int |
value | ) |
|
Set the buffer state
- Parameters
-
| int esnlib::IoBuffer::type |
( |
| ) |
const |
Get the buffer type
- Returns
- The buffer type
| void esnlib::IoBuffer::type |
( |
int |
value | ) |
|
Set the buffer type
- Parameters
-
The documentation for this class was generated from the following file: