24 return std::string((
const char *)buf.
c_data(), buf.
size());
30 return std::string((
const char *)buf.
c_data(), buf.
size());
36 buf.
write((
unsigned char *)str.c_str(), str.length());
42 buf.
write((
unsigned char *)str, std::strlen(str));
48 const size_t len = str.length();
50 buf->write((
unsigned char *)str.c_str(), len);
57 const size_t len = std::strlen(str);
59 buf->write((
unsigned char *)str, len);
66 const size_t len = str.
length();
68 buf.
write((
unsigned char *)str.c_str(), len);
75 const size_t len = std::strlen(str);
77 buf.
write((
unsigned char *)str, len);
84 buf.
write((
unsigned char *)str.c_str(), str.length());
90 buf.
write((
unsigned char *)str, std::strlen(str));
97 return ConstBuffer((
const unsigned char *)str.c_str(), str.size(),
true);
104 return (
const char *)buf.
c_data();
110 if (buf.
size() != str.length())
112 return std::memcmp(buf.
c_data(), str.c_str(), buf.
size()) == 0;
const T * c_data() const
Returns a const pointer to the start of the buffer.
size_t length() const
Returns the length of the buffer.
size_t size() const
Returns the size of the buffer in T objects.
void write(const T *data, const size_t size)
Write data to the buffer.
static Ptr Create(ArgsT &&...args)
Creates a new instance of RcEnable with the given arguments.
Support deferred server-side state creation when client connects.
const char * buf_c_str(const Buffer &buf)
BufferAllocated buf_alloc_from_string(const std::string &str)
ConstBufferType< unsigned char > ConstBuffer
ConstBuffer const_buf_from_string(const std::string &str)
void buf_append_string(Buffer &buf, const std::string &str)
bool buf_eq_str(const Buffer &buf, const std::string &str)
BufferPtr buf_from_string(const std::string &str)
std::string buf_to_string(const Buffer &buf)
void buf_write_string(Buffer &buf, const std::string &str)