memory_content
Defined in header: <orcus/stream.hpp>
-
class memory_content
Represents the content of an in-memory buffer. Note that this class will NOT own the content of the source buffer but simply will reference it, except when the original buffer is a non-utf-8 stream and the caller chooses to convert it to utf-8 by calling its convert_to_utf8() method.
Public Functions
-
memory_content(const file_content&) = delete
-
memory_content &operator=(const file_content&) = delete
-
memory_content()
-
memory_content(std::string_view s)
-
memory_content(memory_content &&other)
-
~memory_content()
-
const char *data() const
-
size_t size() const
-
bool empty() const
-
void swap(memory_content &other)
-
void convert_to_utf8()
Convert a non-utf-8 stream to a utf-8 one if the source stream contains a byte order mark. If not, it does nothing. When the conversion happens, the converted content will be owned by the object.
-
std::string_view str() const
-
memory_content(const file_content&) = delete