A chunk of writable memory. More...
#include <TsBuffer.h>
Public Types | |
typedef Buffer | self |
Self reference type. | |
typedef bool(self::* | pseudo_bool )() const |
Public Member Functions | |
Buffer () | |
Default constructor (empty buffer). | |
Buffer (char *ptr, size_t n) | |
Construct from pointer and size. | |
Buffer (char *start, char *end) | |
Construct from two pointers. | |
bool | operator== (self const &that) const |
Equality. | |
bool | operator!= (self const &that) const |
Inequality. | |
bool | operator== (ConstBuffer const &that) const |
Equality for a constant buffer. | |
bool | operator!= (ConstBuffer const &that) const |
Inequality. | |
char | operator* () const |
self & | operator++ () |
Discard the first character in the buffer. | |
bool | operator! () const |
Check for empty buffer. | |
operator pseudo_bool () const | |
Check for non-empty buffer. | |
self & | set (char *ptr, size_t n=0) |
Set the chunk. | |
self & | reset () |
Reset to empty. | |
Accessors. | |
char * | data () const |
Get the data in the buffer. | |
size_t | size () const |
Get the size of the buffer. | |
Data Fields | |
char * | _ptr |
Pointer to base of memory chunk. | |
size_t | _size |
Size of memory chunk. |
A chunk of writable memory.
A convenience class because we pass this kind of pair frequently.
Buffer
use Buffer(0)
. Definition at line 48 of file TsBuffer.h.
typedef bool(self::* ts::Buffer::pseudo_bool)() const |
Definition at line 50 of file TsBuffer.h.
typedef Buffer ts::Buffer::self |
Self reference type.
Definition at line 49 of file TsBuffer.h.
ts::Buffer::Buffer | ( | ) | [inline] |
Default constructor (empty buffer).
Definition at line 298 of file TsBuffer.h.
ts::Buffer::Buffer | ( | char * | ptr, | |
size_t | n | |||
) | [inline] |
Construct from pointer and size.
ptr | Pointer to buffer. | |
n | Size of buffer. |
Definition at line 299 of file TsBuffer.h.
ts::Buffer::Buffer | ( | char * | start, | |
char * | end | |||
) | [inline] |
Construct from two pointers.
start | First valid character. | |
end | First invalid character. |
Definition at line 301 of file TsBuffer.h.
char * ts::Buffer::data | ( | ) | const [inline] |
ts::Buffer::operator pseudo_bool | ( | ) | const [inline] |
Check for non-empty buffer.
true
if the buffer has a non-zero pointer and size. Definition at line 312 of file TsBuffer.h.
bool ts::Buffer::operator! | ( | ) | const [inline] |
Check for empty buffer.
true
if the buffer has a zero pointer or size. Definition at line 311 of file TsBuffer.h.
bool ts::Buffer::operator!= | ( | ConstBuffer const & | that | ) | const [inline] |
Inequality.
true
if that does not refer to the same memory as this, false
otherwise. Definition at line 304 of file TsBuffer.h.
bool ts::Buffer::operator!= | ( | self const & | that | ) | const [inline] |
Inequality.
true
if that does not refer to the same memory as this, false
otherwise. Definition at line 303 of file TsBuffer.h.
char ts::Buffer::operator* | ( | ) | const [inline] |
Definition at line 313 of file TsBuffer.h.
References _ptr.
Buffer & ts::Buffer::operator++ | ( | ) | [inline] |
Discard the first character in the buffer.
Definition at line 314 of file TsBuffer.h.
bool ts::Buffer::operator== | ( | self const & | that | ) | const [inline] |
Equality.
true
if that refers to the same memory as this, false
otherwise. Definition at line 305 of file TsBuffer.h.
bool ts::Buffer::operator== | ( | ConstBuffer const & | that | ) | const [inline] |
Equality for a constant buffer.
true
if that refers to the same memory as this. false
otherwise. Definition at line 308 of file TsBuffer.h.
References ts::ConstBuffer::_ptr, _ptr, ts::ConstBuffer::_size, and _size.
Buffer & ts::Buffer::reset | ( | ) | [inline] |
Reset to empty.
Definition at line 302 of file TsBuffer.h.
Referenced by ts::config::Builder::pathClose(), and ts::config::Builder::pathOpen().
Buffer & ts::Buffer::set | ( | char * | ptr, | |
size_t | n = 0 | |||
) | [inline] |
Set the chunk.
Any previous values are discarded.
this
object. Definition at line 300 of file TsBuffer.h.
Referenced by ts::config::Builder::groupName(), ts::config::Builder::literalValue(), ts::config::Builder::pathIndex(), and ts::config::Builder::pathTag().
size_t ts::Buffer::size | ( | void | ) | const [inline] |
char* ts::Buffer::_ptr |
Pointer to base of memory chunk.
Definition at line 52 of file TsBuffer.h.
Referenced by ts::config::detail::ValueTable::alloc(), ts::config::Builder::build(), data(), ts::config::Builder::literalValue(), ts::config::Configuration::loadFromPath(), operator pseudo_bool(), operator!(), operator*(), operator++(), ts::ConstBuffer::operator=(), ts::ConstBuffer::operator==(), operator==(), ts::config::Builder::pathClose(), ts::config::Builder::pathIndex(), ts::config::Builder::pathTag(), reset(), and set().
size_t ts::Buffer::_size |
Size of memory chunk.
Definition at line 53 of file TsBuffer.h.
Referenced by ts::config::Builder::build(), ts::config::Builder::literalValue(), ts::config::Configuration::loadFromPath(), operator pseudo_bool(), operator!(), operator++(), ts::ConstBuffer::operator=(), ts::ConstBuffer::operator==(), operator==(), ts::config::Builder::pathClose(), ts::config::Builder::pathIndex(), ts::config::Builder::pathTag(), reset(), set(), and size().