15 #include <vsg/core/Export.h>
29 mem_stream(
const std::string& str, std::string::size_type pos, std::string::size_type length);
30 explicit mem_stream(
const std::string_view& sv);
33 void set(
const uint8_t* ptr,
size_t length);
36 void set(
const std::string_view& sv) {
set(
reinterpret_cast<const uint8_t*
>(sv.data()), sv.size()); }
39 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); }
42 struct mem_buffer :
public std::streambuf
44 mem_buffer(
const uint8_t* ptr,
size_t length);
46 inline void set(
const uint8_t* ptr,
size_t length)
48 setg((
char*)(ptr), (
char*)(ptr), (
char*)(ptr) + length);
Definition: mem_stream.h:26
void set(const std::string_view &sv)
set the mem_stream to string_view
Definition: mem_stream.h:36
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:39