#include <buffer.h>
Public Member Functions | |
buffer (void) | |
~buffer (void) | |
void | write (const std::string data) |
Write a specific string to the buffer. | |
int | fwrite (int fd) |
Write the buffer with the contents of a file, return 1 when error. | |
char * | writing (int bytes) |
Claim space in the buffer to be able to write data to it. | |
void | wrote (int bytes) |
Tell that you actual wrote this amount of data. | |
char * | send (long *length) |
Finished a set of data to send. | |
unsigned long | bytes (void) |
Number of bytes still the buffer to read. | |
char * | ptr (void) |
Pointer to the current read position. | |
void | done (unsigned long bytes) |
Tell what part of the data you managed to read at this time. |
A buffer that accepts data written to it even during transmitting data from another part of the buffer.
buffer::buffer | ( | void | ) |
buffer::~buffer | ( | void | ) |
void buffer::write | ( | const std::string | data | ) |
Write a specific string to the buffer.
Beware that this function doesn't write trailing zero's after strings.
int buffer::fwrite | ( | int | fd | ) |
Write the buffer with the contents of a file, return 1 when error.
char * buffer::writing | ( | int | bytes | ) |
Claim space in the buffer to be able to write data to it.
void buffer::wrote | ( | int | bytes | ) |
Tell that you actual wrote this amount of data.
char * buffer::send | ( | long * | length | ) |
Finished a set of data to send.
unsigned long buffer::bytes | ( | void | ) |
Number of bytes still the buffer to read.
char * buffer::ptr | ( | void | ) |
Pointer to the current read position.
void buffer::done | ( | unsigned long | bytes | ) |
Tell what part of the data you managed to read at this time.