Class representing a general-use automatically managed/resized buffer. More...
#include <buffer.hpp>
Public Member Functions | |
Buffer () | |
Creates an empty buffer. More... | |
Buffer (size_t size) | |
Creates a buffer with pre-allocated size. More... | |
Buffer (const void *buf, size_t length) | |
Create a buffer by copying contents from a buffer. More... | |
template<class InputIterator > | |
Buffer (InputIterator first, InputIterator last) | |
Create a buffer by copying contents of the range [first, last) More... | |
uint8_t * | get () |
uint8_t * | buf () |
template<class T > | |
T * | get () |
const uint8_t * | buf () const |
const uint8_t * | get () const |
template<class T > | |
const T * | get () const |
Class representing a general-use automatically managed/resized buffer.
In most respect, Buffer class is equivalent to std::vector<uint8_t> and is in fact uses it as a base class. In addition to that, it provides buf() and buf<T>() helper method for easier access to the underlying data (buf<T>() casts pointer to the requested class)
Definition at line 44 of file buffer.hpp.
ndn::Buffer::Buffer | ( | ) |
Creates an empty buffer.
Definition at line 38 of file buffer.cpp.
|
explicit |
Creates a buffer with pre-allocated size.
size | size of the buffer to be allocated |
Definition at line 42 of file buffer.cpp.
ndn::Buffer::Buffer | ( | const void * | buf, |
size_t | length | ||
) |
Create a buffer by copying contents from a buffer.
buf | const pointer to buffer |
length | length of the buffer to copy |
Definition at line 47 of file buffer.cpp.
|
inline |
Create a buffer by copying contents of the range [first, last)
InputIterator | an InputIterator compatible with std::vector<uint8_t> constructor |
first | iterator to the first element to copy |
last | iterator to the element immediately following the last element to copy |
Definition at line 69 of file buffer.hpp.
|
inline |
Definition at line 77 of file buffer.hpp.
Referenced by ndn::security::SafeBag::wireEncode().
|
inline |
This is same as .get()
Definition at line 87 of file buffer.hpp.
Referenced by ndn::security::SecPublicInfoSqlite3::addKey(), ndn::security::PibSqlite3::addKey(), ndn::security::v1::PublicKey::computeDigest(), ndn::security::v1::CertificateExtension::encode(), ndn::security::v1::PublicKey::encode(), ndn::security::v1::operator<<(), ndn::printHex(), ndn::toHex(), and ndn::security::Validator::verifySignature().
|
inline |
Definition at line 97 of file buffer.hpp.
|
inline |
This is same as .get()
Definition at line 107 of file buffer.hpp.
|
inline |
Definition at line 115 of file buffer.hpp.
|
inline |
Definition at line 125 of file buffer.hpp.