36 std::unique_ptr<char[]> data(
new char[x]);
37 size_t newSize = std::min(
m_size, x);
66 std::copy(data, data+size_,
m_data.get());
84 m_data = std::move(x.m_data);
109 m_data.reset(
new char[size_]);
113 std::copy(data, data+size_,
m_data.get());
void assign(const char *const data, const size_t size_)
Assign a sequence a data to the block.
size_t size() const
See the relevant data size.
size_t reserve() const
See the reserve size.
size_t m_reserve
Total bytes allocated.
size_t m_size
Size of relevant part of data allocation.
std::unique_ptr< char[]> m_data
Point to allocated data.
Declares the Block data structure.
void clear()
Deallocate memory and set size and reserve to zero.
Block & operator=(Block &&x)
Steal the data from another block.
Block()
Initialize an empty block.
Data structure to hold a block of raw data.