UTF-8 prefix()/get()

This commit is contained in:
Ferdinand Majerech 2014-07-29 02:59:16 +02:00
parent 709ab00e44
commit 2e156a8ece

View file

@ -200,6 +200,10 @@ final class Reader
{ {
return slice(0, length); return slice(0, length);
} }
char[] prefix8(const size_t length) @safe pure nothrow @nogc
{
return slice8(length);
}
/// Get a slice view of the internal buffer. /// Get a slice view of the internal buffer.
/// ///
@ -265,6 +269,12 @@ final class Reader
forward(length); forward(length);
return result; return result;
} }
char[] get8(const size_t length) @safe pure nothrow @nogc
{
auto result = prefix8(length);
forward(length);
return result;
}
/// Move current position forward. /// Move current position forward.
/// ///