diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Handle.cc | 12 | ||||
-rw-r--r-- | src/SimpleMustache.cc | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/Handle.cc b/src/Handle.cc index 67eb412..361561a 100644 --- a/src/Handle.cc +++ b/src/Handle.cc @@ -94,6 +94,18 @@ ssize_t Balau::Handle::forceWrite(const void * _buf, size_t count, Events::BaseE return total; } +Balau::Future<uint8_t> Balau::Handle::readU8() { + IO<Handle> t(this); + auto func = [t]() mutable -> uint8_t { + uint8_t r; + t->read(&r, 1); + return r; + }; + Future<uint8_t> r; + r.m_run = func; + return r; +} + void Balau::Handle::rseek(off_t offset, int whence) throw (GeneralException) { if (canSeek()) throw GeneralException(String("Handle ") + getName() + " can seek, but rseek() not implemented (missing in class " + ClassName(this).c_str() + ")"); diff --git a/src/SimpleMustache.cc b/src/SimpleMustache.cc index 6f7acdc..eef4b01 100644 --- a/src/SimpleMustache.cc +++ b/src/SimpleMustache.cc @@ -149,7 +149,7 @@ void Balau::SimpleMustache::setTemplate(IO<Handle> _h) { bool beginning = false; while (!h->isEOF()) { - uint8_t c = h->readU8(); + uint8_t c = h->readU8().get(); switch (state) { case PLAIN: if (c != srtMarker[0]) { |