X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fio%2Fmemory.cpp;h=6ccf84654764cbe8086a3ac841330580d302dcd1;hp=4a6296b44a907321a5e04a585e229523ff7caf86;hb=df5ab3d867c51d72344e443e3adb05bfa29a2b53;hpb=a56e05106571f28dc3044296849ccd5127d7d859 diff --git a/source/io/memory.cpp b/source/io/memory.cpp index 4a6296b..6ccf846 100644 --- a/source/io/memory.cpp +++ b/source/io/memory.cpp @@ -39,7 +39,7 @@ void Memory::init(char *b, char *e, Mode m) unsigned Memory::do_write(const char *buf, unsigned size) { - check_mode(M_WRITE); + check_access(M_WRITE); size = min(size, end-pos); memcpy(pos, buf, size); @@ -63,7 +63,7 @@ unsigned Memory::do_read(char *buf, unsigned size) unsigned Memory::put(char c) { - check_mode(M_WRITE); + check_access(M_WRITE); *pos++ = c; return 1; } @@ -107,11 +107,5 @@ SeekOffset Memory::seek(SeekOffset off, SeekType type) return pos-begin; } -void Memory::check_mode(Mode m) const -{ - if(m==M_WRITE && !(mode&M_WRITE)) - throw invalid_access(M_WRITE); -} - } // namespace IO } // namespace Msp