26#ifndef ROUTER_SRC_HTTP_INCLUDE_HTTP_BASE_IO_BUFFER_H_
27#define ROUTER_SRC_HTTP_INCLUDE_HTTP_BASE_IO_BUFFER_H_
51 virtual void clear() { content_.clear(); }
52 virtual size_t length()
const {
return content_.length(); }
57 std::vector<uint8_t>
result;
59 if (
size > content_.length())
size = content_.length();
61 result.assign(content_.begin(), content_.begin() +
size);
63 content_.erase(0,
size);
68 virtual std::vector<uint8_t>
copy(
size_t size)
const {
69 std::vector<uint8_t>
result;
71 if (
size > content_.length())
size = content_.length();
73 result.assign(content_.begin(), content_.begin() +
size);
79 content_.append(data,
length);
82 virtual const std::string &
get()
const {
return content_; }
83 virtual std::string &
get() {
return content_; }
Definition: io_buffer.h:41
virtual const std::string & get() const
Definition: io_buffer.h:82
virtual size_t length() const
Definition: io_buffer.h:52
virtual CIterator begin() const
Definition: io_buffer.h:53
virtual CIterator end() const
Definition: io_buffer.h:54
virtual std::vector< uint8_t > pop_front(size_t size)
Definition: io_buffer.h:56
virtual void add(const char *data, size_t length)
Definition: io_buffer.h:78
std::string::const_iterator CIterator
Definition: io_buffer.h:43
IOBuffer(std::string value)
Definition: io_buffer.h:47
virtual std::vector< uint8_t > copy(size_t size) const
Definition: io_buffer.h:68
std::string content_
Definition: io_buffer.h:86
IOBuffer(const char *data, size_t length)
Definition: io_buffer.h:45
virtual void clear()
Definition: io_buffer.h:51
virtual std::string & get()
Definition: io_buffer.h:83
#define HTTP_COMMON_EXPORT
Definition: http_common_export.h:15
Some integer typedefs for easier portability.
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
Definition: connection.h:56
size_t size(const char *const c)
Definition: base64.h:46
Definition: gcs_xcom_synode.h:64
struct result result
Definition: result.h:34