#include <ByteBuffer.hpp>
Public Member Functions | |
| ByteBuffer () | |
| ByteBuffer (const char *str) | |
| ByteBuffer (const char *ptr, size_t len) | |
| ByteBuffer (const ByteBuffer &buf) | |
| ~ByteBuffer () | |
| void | clear () |
| Remove all data from the ByteBuffer. | |
| bool | empty () const |
| Return true if the ByteBuffer is empty (size() == 0). | |
| size_t | size () const |
| Return the number of bytes in this ByteBuffer. | |
| const char * | data () const |
| Returns a pointer to the data stored in the ByteBuffer. | |
| char | at (size_t pos) const |
| Return the byte at position pos. | |
| void | append (const char *ptr, size_t len) |
| Append new data to this ByteBuffer object. | |
| void | append (char c) |
| Append a new byte to this ByteBuffer object. | |
| ByteBuffer & | operator= (const ByteBuffer &buf) |
| Assigns buf to this ByteBuffer object. | |
| const char & | operator[] (size_t pos) const |
| Return the byte at position pos. | |
| char & | operator[] (size_t pos) |
| Return the byte at position pos. | |
| ByteBuffer & | operator+= (const ByteBuffer &buf) |
| Appends data from the ByteBuffer object buf. | |
Private Attributes | |
| blocxx::COWIntrusiveReference< ByteBufferImpl > | m_impl |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const ByteBuffer &buf) |
| bool | operator== (const ByteBuffer &l, const ByteBuffer &r) |
| bool | operator!= (const ByteBuffer &l, const ByteBuffer &r) |
| bool | operator< (const ByteBuffer &l, const ByteBuffer &r) |
| bool | operator> (const ByteBuffer &l, const ByteBuffer &r) |
| bool | operator<= (const ByteBuffer &l, const ByteBuffer &r) |
| bool | operator>= (const ByteBuffer &l, const ByteBuffer &r) |
| ByteBuffer | operator+ (const ByteBuffer &b1, const ByteBuffer &b2) |
The class implements a byte buffer useful for manipulating memory areas with custom data.
It is reference counted and supports copy on write functionality.
|
|
Create an empty ByteBuffer object. |
|
|
Create a ByteBuffer object and initialize it with the C string provided in str. The size is determined using the strlen(str) function.
|
|
||||||||||||
|
Create a ByteBuffer object that will contain a copy of the given character array ptr and its size given in len.
|
|
|
Create a new ByteBuffer object that is a shared copy of an another ByteBuffer object. Upon return, both objects will point to the same underlying byte buffer. This state will remain until one of the objects is modified (copy on write).
|
|
|
Destroy the ByteBuffer object. |
|
|
Append a new byte to this ByteBuffer object.
|
|
||||||||||||
|
Append new data to this ByteBuffer object.
|
|
|
Return the byte at position pos.
|
|
|
Remove all data from the ByteBuffer. The size() of the ByteBuffer should be zero after calling this method.
|
|
|
Returns a pointer to the data stored in the ByteBuffer.
|
|
|
Return true if the ByteBuffer is empty (size() == 0).
|
|
|
Appends data from the ByteBuffer object buf. Appends data from the specified ByteBuffer object buf to the end of this ByteBuffer object and returns a reference to this ByteBuffer object.
|
|
|
Assigns buf to this ByteBuffer object. Assigns buf to this ByteBuffer object and returns a reference to this ByteBuffer object.
|
|
|
Return the byte at position pos.
|
|
|
Return the byte at position pos.
|
|
|
Return the number of bytes in this ByteBuffer.
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
A stream output operator for debugging purposes. |
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
|
|
1.4.6