CACAO
|
Data Structures | |
struct | Encode |
Public Member Functions | |
Buffer (size_t initial_size=64) | |
~Buffer () | |
Buffer & | write (char) |
Buffer & | write (Utf8String) |
Buffer & | write (JavaString) |
Buffer & | write (const char *) |
Buffer & | write (const char *, size_t) |
Buffer & | write (const uint16_t *, size_t) |
Buffer & | write_slash_to_dot (const char *) |
write to buffer, replacing '/' by '.' More... | |
Buffer & | write_slash_to_dot (Utf8String) |
Buffer & | write_dot_to_slash (Utf8String) |
write to buffer, replacing '.' by '/' More... | |
template<typename A > | |
Buffer & | write (Buffer< A > &src) |
copy contents of buffer (calls c_str() on src) More... | |
Buffer & | write_ptr (void *) |
write address of pointer as hex to buffer More... | |
Buffer & | write_dec (s4) |
write number to buffer as decimal More... | |
Buffer & | write_dec (s8) |
Buffer & | write_dec (float) |
Buffer & | write_dec (double) |
Buffer & | write_hex (s4) |
write number to buffer as hexadecimal More... | |
Buffer & | write_hex (s8) |
Buffer & | write_hex (float) |
Buffer & | write_hex (double) |
Buffer & | writef (const char *fmt,...) |
Buffer & | writevf (const char *fmt, va_list ap) |
Buffer & | zero_terminate () |
ensure string in buffer is zero terminated More... | |
const char * | c_str () |
get contents of buffer as zero-terminated c-style-string This strings lifetime is tied to it's buffer. More... | |
const char * | c_str_copy () |
get copy contents of buffer as zero-terminated c-style-string You must free the returned string yourself ( use a copy of the buffer's allocator via get_allocator()) More... | |
Utf8String | utf8_str () |
get utf-8 string contents of buffer as utf8-string More... | |
uint8_t * | data () |
get raw contents of buffer (not necessarily zero terminated). More... | |
const uint8_t * | data () const |
size_t | size () |
get size of buffer contents More... | |
void | reset () |
Reset buffer position to start of buffer. More... | |
void | skip (size_t num_bytes) |
advance buffer position by n bytes O(1) More... | |
void | rewind (size_t bytes_to_drop) |
remove data from the back of this buffer. More... | |
void | ensure_capacity (size_t sz) |
ensure buffer contains space for at least sz bytes More... | |
Private Member Functions | |
Buffer (const Buffer &) | |
non-copyable More... | |
Buffer & | operator= (const Buffer &) |
non-assignable More... | |
Private Attributes | |
uint8_t * | _start |
uint8_t * | _end |
uint8_t * | _pos |
Allocator | _alloc |
Definition at line 54 of file buffer.hpp.
Definition at line 185 of file buffer.hpp.
Definition at line 193 of file buffer.hpp.
|
private |
non-copyable
|
inline |
get contents of buffer as zero-terminated c-style-string This strings lifetime is tied to it's buffer.
Definition at line 489 of file buffer.hpp.
|
inline |
get copy contents of buffer as zero-terminated c-style-string You must free the returned string yourself ( use a copy of the buffer's allocator via get_allocator())
|
inline |
get raw contents of buffer (not necessarily zero terminated).
Definition at line 523 of file buffer.hpp.
|
inline |
Definition at line 529 of file buffer.hpp.
ensure buffer contains space for at least sz bytes
Definition at line 591 of file buffer.hpp.
|
private |
non-assignable
Reset buffer position to start of buffer.
This effectively clears the buffer. O(1)
Definition at line 553 of file buffer.hpp.
get size of buffer contents
Definition at line 541 of file buffer.hpp.
|
inline |
advance buffer position by n bytes O(1)
|
inline |
get utf-8 string contents of buffer as utf8-string
Definition at line 506 of file buffer.hpp.
Definition at line 280 of file buffer.hpp.
|
inline |
Definition at line 207 of file buffer.hpp.
|
inline |
Definition at line 220 of file buffer.hpp.
|
inline |
Definition at line 233 of file buffer.hpp.
|
inline |
Definition at line 246 of file buffer.hpp.
|
inline |
Definition at line 265 of file buffer.hpp.
|
inline |
copy contents of buffer (calls c_str() on src)
Definition at line 82 of file buffer.hpp.
write number to buffer as decimal
Definition at line 366 of file buffer.hpp.
Definition at line 371 of file buffer.hpp.
|
inline |
Definition at line 376 of file buffer.hpp.
|
inline |
Definition at line 381 of file buffer.hpp.
|
inline |
write to buffer, replacing '.' by '/'
Definition at line 338 of file buffer.hpp.
write number to buffer as hexadecimal
Definition at line 386 of file buffer.hpp.
Definition at line 391 of file buffer.hpp.
|
inline |
Definition at line 396 of file buffer.hpp.
|
inline |
Definition at line 408 of file buffer.hpp.
|
inline |
write address of pointer as hex to buffer
Definition at line 361 of file buffer.hpp.
|
inline |
write to buffer, replacing '/' by '.'
Definition at line 297 of file buffer.hpp.
|
inline |
Definition at line 315 of file buffer.hpp.
|
inline |
Definition at line 426 of file buffer.hpp.
|
inline |
Definition at line 438 of file buffer.hpp.
ensure string in buffer is zero terminated
Definition at line 470 of file buffer.hpp.
|
private |
Definition at line 156 of file buffer.hpp.
|
private |
Definition at line 155 of file buffer.hpp.
|
private |
Definition at line 155 of file buffer.hpp.
|
private |
Definition at line 155 of file buffer.hpp.