10#ifndef MSGPACK_V1_SBUFFER_HPP
11#define MSGPACK_V1_SBUFFER_HPP
35 throw std::bad_alloc();
45#if !defined(MSGPACK_USE_CPP03)
60 m_size =
other.m_size;
61 m_alloc =
other.m_alloc;
62 m_data =
other.m_data;
77 if(m_alloc - m_size <
len) {
80 std::memcpy(m_data + m_size,
buf,
len);
114 void expand_buffer(
size_t len)
116 size_t nsize = (m_alloc > 0) ?
130 throw std::bad_alloc();
133 m_data =
static_cast<char*
>(
tmp);
137#if defined(MSGPACK_USE_CPP03)
#define MSGPACK_ASSERT
Definition assert.hpp:22
Definition sbuffer.hpp:26
sbuffer(sbuffer &&other)
Definition sbuffer.hpp:49
sbuffer(const sbuffer &)=delete
const char * data() const
Definition sbuffer.hpp:89
char * data()
Definition sbuffer.hpp:84
sbuffer & operator=(const sbuffer &)=delete
char * release()
Definition sbuffer.hpp:99
sbuffer(size_t initsz=MSGPACK_SBUFFER_INIT_SIZE)
Definition sbuffer.hpp:28
~sbuffer()
Definition sbuffer.hpp:40
void clear()
Definition sbuffer.hpp:108
sbuffer & operator=(sbuffer &&other)
Definition sbuffer.hpp:56
size_t size() const
Definition sbuffer.hpp:94
void write(const char *buf, size_t len)
Definition sbuffer.hpp:71
Definition adaptor_base.hpp:15
void convert(T &v, msgpack::object const &o)
Definition object.hpp:1178
#define MSGPACK_NULLPTR
Definition cpp_config_decl.hpp:85
#define MSGPACK_SBUFFER_INIT_SIZE
Definition sbuffer_decl.hpp:16
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition versioning.hpp:66