Change API of raw_istream to be more similar to raw_ostream.

This commit is contained in:
Peter Johnson
2016-09-02 20:53:45 -07:00
parent b2e1291973
commit 4c6c096c50
5 changed files with 41 additions and 15 deletions

View File

@@ -11,10 +11,14 @@
using namespace wpi;
bool raw_mem_istream::read(void* data, std::size_t len) {
if (len > m_left) return false;
void raw_mem_istream::close() {}
void raw_mem_istream::read_impl(void* data, std::size_t len) {
if (len > m_left) {
error_detected();
return;
}
std::memcpy(data, m_cur, len);
m_cur += len;
m_left -= len;
return true;
}