Equivalent to a pair<const void*, size_t>: this is just a convenient way of passing a reference to an immutable data buffer.
|
Public Methods |
| | constbuf () |
| | Null constructor.
|
| | constbuf (const void *dat, unsigned int len) |
| | Constructs a reference to an immutable data buffer.
|
| | constbuf (const string &s) |
| | Constructs a reference to a string.
|
| const char * | data () const |
| | Returns a pointer to the beginning of the data buffer.
|
| unsigned int | length () const |
| | Returns the length of the data buffer.
|
| | operator const void * () const |
| | Returns a non-null value if the data buffer is non-null.
|
| | operator string () const |
| | Returns the constbuf as a string (always makes a copy).
|
| string | as_string () const |
| | Returns a human-readable representation of the data buffer.
|
Protected Attributes |
| char * | dat |
| unsigned int | len |