20 #ifndef RIPPLE_BASICS_BUFFER_H_INCLUDED
21 #define RIPPLE_BASICS_BUFFER_H_INCLUDED
23 #include <ripple/basics/Slice.h>
85 :
p_(std::move(other.p_)),
size_(other.size_)
98 p_ = std::move(other.p_);
221 if (lhs.size() != rhs.size())
227 return std::memcmp(lhs.data(), rhs.data(), lhs.size()) == 0;
233 return !(lhs == rhs);
std::size_t size() const noexcept
Returns the number of bytes in the storage.
const_iterator cbegin() const noexcept
An immutable linear range of bytes.
const_iterator cend() const noexcept
Buffer & operator=(Buffer &&other) noexcept
Move-assign.
std::uint8_t const * data() const noexcept
Return a pointer to beginning of the storage.
bool empty() const noexcept
Like std::vector<char> but better.
void * operator()(std::size_t n)
Buffer(Buffer const &other)
Copy-construct.
Buffer(Buffer &&other) noexcept
Move-construct.
bool operator==(Manifest const &lhs, Manifest const &rhs)
const_iterator end() const noexcept
void clear() noexcept
Reset the buffer.
Buffer(Slice s)
Construct from a slice.
bool operator!=(Manifest const &lhs, Manifest const &rhs)
std::size_t size() const noexcept
Returns the number of bytes in the buffer.
std::uint8_t const * data() const noexcept
Return a pointer to beginning of the storage.
std::uint8_t * data() noexcept
const_iterator begin() const noexcept
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Buffer(void const *data, std::size_t size)
Create a buffer as a copy of existing memory.
std::uint8_t const * const_iterator
Buffer & operator=(Slice s)
Assign from slice.
std::unique_ptr< std::uint8_t[]> p_
std::uint8_t * alloc(std::size_t n)
Reallocate the storage.
Buffer(std::size_t size)
Create an uninitialized buffer with the given size.
Buffer & operator=(Buffer const &other)
Copy assign.
T & get(EitherAmount &amt)