From 2e156a8ece65539f3a1495956aaf1b90af875fff Mon Sep 17 00:00:00 2001 From: Ferdinand Majerech Date: Tue, 29 Jul 2014 02:59:16 +0200 Subject: [PATCH] UTF-8 prefix()/get() --- source/dyaml/reader.d | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/dyaml/reader.d b/source/dyaml/reader.d index e8f09a4..cc8f5d8 100644 --- a/source/dyaml/reader.d +++ b/source/dyaml/reader.d @@ -200,6 +200,10 @@ final class Reader { 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. /// @@ -265,6 +269,12 @@ final class Reader forward(length); return result; } + char[] get8(const size_t length) @safe pure nothrow @nogc + { + auto result = prefix8(length); + forward(length); + return result; + } /// Move current position forward. ///