Orcus
|
#include <stream.hpp>
Public Member Functions | |
memory_content (const file_content &)=delete | |
memory_content & | operator= (const file_content &)=delete |
memory_content (const char *p, size_t n) | |
memory_content (memory_content &&other) | |
const char * | data () const |
size_t | size () const |
bool | empty () const |
void | swap (memory_content &other) |
void | convert_to_utf8 () |
pstring | str () const |
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 memory_content#convert_to_utf8() method.
void orcus::memory_content::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.