#include <buffer.hpp>
Public Member Functions | |
| buffer ()=default | |
| buffer (const buffer &x)=delete | |
| buffer & | operator= (const buffer &x)=delete |
| ~buffer ()=default | |
| void | append (const char *chunk, std::size_t size) |
| void | append (const buffer &buf) |
| void | append (const std::string &str) |
| char * | data () |
| const char * | data () const |
| std::size_t | capacity () const |
| std::size_t | size () const |
| void | size (std::size_t s) |
| bool | empty () const |
| void | clear () |
Simple buffer class with a fixed size of 16384 bytes.
|
default |
Creates an empty buffer
|
delete |
Copy constructs from given buffer x
| x | Buffer to copy from |
|
default |
Destroys the buffer
| void matador::buffer::append | ( | const buffer & | buf | ) |
Appends the given buffer to this buffer. If the new buffer size exceeds the maximum size of the buffer an out of bound exception is thrown
| buf | Buffer to append |
| void matador::buffer::append | ( | const char * | chunk, |
| std::size_t | size | ||
| ) |
Appends the given chunk of the given size to the buffer. If the new buffer size exceeds the maximum size of the buffer an out of bound exception is thrown
| chunk | Chunk to append |
| size | Size of the chunk to append |
| void matador::buffer::append | ( | const std::string & | str | ) |
Appends the given string to this buffer. If the new buffer size exceeds the maximum size of the buffer an out of bound exception is thrown
| str | String to append |
| std::size_t matador::buffer::capacity | ( | ) | const |
Returns the capacity of the buffer i.e. 16384 bytes
| void matador::buffer::clear | ( | ) |
Empties the buffer
| char * matador::buffer::data | ( | ) |
Pointer to the beginning of the buffer data
| const char * matador::buffer::data | ( | ) | const |
Pointer to the beginning of the buffer data
| bool matador::buffer::empty | ( | ) | const |
Returns true if the buffer is empty
Copy assigns from given buffer x
| x | Buffer to assign from |
| std::size_t matador::buffer::size | ( | ) | const |
Returns the current size of buffer data.
| void matador::buffer::size | ( | std::size_t | s | ) |
Sets the new size of the buffer
| s | Size of the buffer |