Buffer is implemented as holding a smart pointer to a std::vector of characters.
Public Member Functions | |
| std::vector< char > & | data () |
| Returns a pointer to the internal array of bytes. | |
| const std::vector< char > & | data () const |
| Returns a constant pointer to the internal array of bytes. | |
| int | getLength () const |
| Returns current buffer length. | |
| int | size () const |
| Identical to getLength(). | |
| bool | empty () const |
| void | assign (const char *buf, int buflen) |
| Buffer (const char *buf, int buflen) | |
| Construct out of passed in buffer. | |
| Buffer (const std::vector< char > &buf) | |
| Construct out of passed in std::vector of char. | |
| Buffer (const Buffer &orig, int st_ind, int end_ind) | |
| Construct a buffer from another buffer between two indices. | |
| Buffer (int buflen) | |
| Construct a buffer of passed in length. | |
| void | append (const Buffer &s) |
| Appends another buffer to this one. | |
| Buffer () | |
| Creates empty buffer. | |
| Buffer | clone () const |
| Makes a wholly separate copy. | |
| char & | operator[] (size_t n) |
| operator [] allows you to use Buffer just like an array. | |
| const char & | operator[] (size_t n) const |
| operator [] allows you to use Buffer just like an array. | |
| const char * | begin () const |
| Returns a pointer to the beginning of the data location. | |
| char * | begin () |
| Returns a pointer to the beginning of the data location. | |
Protected Attributes | |
| InitSmartPtr< std::vector< char > > | d_data |
| code::Buffer::Buffer | ( | const char * | buf, | |
| int | buflen | |||
| ) | [inline] |
Construct out of passed in buffer.
Makes a copy of the buffer, so you can safely delete buf when you are done.
| code::Buffer::Buffer | ( | const std::vector< char > & | buf | ) | [inline] |
Construct out of passed in std::vector of char.
| code::Buffer::Buffer | ( | const Buffer & | orig, | |
| int | st_ind, | |||
| int | end_ind | |||
| ) | [inline] |
Construct a buffer from another buffer between two indices.
| code::Buffer::Buffer | ( | int | buflen | ) | [inline] |
Construct a buffer of passed in length.
Contents of buffer are uninitialized.
| code::Buffer::Buffer | ( | ) | [inline] |
Creates empty buffer.
| void code::Buffer::append | ( | const Buffer & | s | ) | [inline] |
Appends another buffer to this one.
| void code::Buffer::assign | ( | const char * | buf, | |
| int | buflen | |||
| ) | [inline] |
| char* code::Buffer::begin | ( | ) | [inline] |
Returns a pointer to the beginning of the data location.
| const char* code::Buffer::begin | ( | ) | const [inline] |
Returns a pointer to the beginning of the data location.
| Buffer code::Buffer::clone | ( | ) | const [inline] |
Makes a wholly separate copy.
| const std::vector<char>& code::Buffer::data | ( | ) | const [inline] |
Returns a constant pointer to the internal array of bytes.
| std::vector<char>& code::Buffer::data | ( | ) | [inline] |
Returns a pointer to the internal array of bytes.
| bool code::Buffer::empty | ( | ) | const [inline] |
| int code::Buffer::getLength | ( | ) | const [inline] |
Returns current buffer length.
Returns zero if the buffer is empty.
| const char& code::Buffer::operator[] | ( | size_t | n | ) | const [inline] |
| char& code::Buffer::operator[] | ( | size_t | n | ) | [inline] |
| int code::Buffer::size | ( | ) | const [inline] |
Identical to getLength().
InitSmartPtr< std::vector<char> > code::Buffer::d_data [protected] |
1.4.7