1#ifndef XRPL_BASICS_BUFFER_H_INCLUDED
2#define XRPL_BASICS_BUFFER_H_INCLUDED
4#include <xrpl/basics/Slice.h>
5#include <xrpl/beast/utility/instrumentation.h>
66 :
p_(std::move(other.p_)),
size_(other.size_)
79 p_ = std::move(other.p_);
99 "ripple::Buffer::operator=(Slice) : input not a subset");
203 if (lhs.size() != rhs.size())
209 return std::memcmp(lhs.data(), rhs.data(), lhs.size()) == 0;
215 return !(lhs == rhs);
Like std::vector<char> but better.
const_iterator cbegin() const noexcept
void clear() noexcept
Reset the buffer.
const_iterator cend() const noexcept
Buffer & operator=(Buffer &&other) noexcept
Move-assign.
Buffer(std::size_t size)
Create an uninitialized buffer with the given size.
const_iterator begin() const noexcept
Buffer(Buffer &&other) noexcept
Move-construct.
Buffer(Buffer const &other)
Copy-construct.
std::size_t size() const noexcept
Returns the number of bytes in the buffer.
const_iterator end() const noexcept
std::uint8_t * data() noexcept
Buffer(void const *data, std::size_t size)
Create a buffer as a copy of existing memory.
std::uint8_t * alloc(std::size_t n)
Reallocate the storage.
std::unique_ptr< std::uint8_t[]> p_
Buffer & operator=(Slice s)
Assign from slice.
Buffer(Slice s)
Construct from a slice.
std::uint8_t const * const_iterator
void * operator()(std::size_t n)
bool empty() const noexcept
Buffer & operator=(Buffer const &other)
Copy assign.
std::uint8_t const * data() const noexcept
Return a pointer to beginning of the storage.
An immutable linear range of bytes.
std::uint8_t const * data() const noexcept
Return a pointer to beginning of the storage.
std::size_t size() const noexcept
Returns the number of bytes in the storage.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool operator!=(Buffer const &lhs, Buffer const &rhs) noexcept
T get(Section const §ion, std::string const &name, T const &defaultValue=T{})
Retrieve a key/value pair from a section.
constexpr bool operator==(base_uint< Bits, Tag > const &lhs, base_uint< Bits, Tag > const &rhs)