15 #include <vsg/core/Export.h>
28 mem_stream(
const std::string& str, std::string::size_type pos, std::string::size_type length);
29 explicit mem_stream(
const std::string_view& sv);
32 void set(
const uint8_t* ptr,
size_t length);
35 void set(
const std::string_view& sv) {
set(
reinterpret_cast<const uint8_t*
>(sv.data()), sv.size()); }
38 void set(
const std::string& str, std::string::size_type pos, std::string::size_type length) {
set(
reinterpret_cast<const uint8_t*
>(&(str[pos])), length); }
41 struct mem_buffer :
public std::streambuf
43 mem_buffer(
const uint8_t* ptr,
size_t length);
45 inline void set(
const uint8_t* ptr,
size_t length)
47 setg((
char*)(ptr), (
char*)(ptr), (
char*)(ptr) + length);
Definition: mem_stream.h:25
void set(const std::string_view &sv)
set the mem_stream to string_view
Definition: mem_stream.h:35
void set(const uint8_t *ptr, size_t length)
set the mem_stream to memory block
void set(const std::string &str, std::string::size_type pos, std::string::size_type length)
set the mem_stream to portion of string
Definition: mem_stream.h:38