From 67b6a78b347ab7ba269a52d772e79d12444f6e96 Mon Sep 17 00:00:00 2001 From: Pixel Date: Mon, 10 Oct 2011 23:09:53 -0700 Subject: Adding a few more features to Input, and actually creating a slightly better ClassName system, when using gcc and libstdc++. --- src/Handle.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/Handle.cc') diff --git a/src/Handle.cc b/src/Handle.cc index dc4e257..e00bcf2 100644 --- a/src/Handle.cc +++ b/src/Handle.cc @@ -55,7 +55,7 @@ time_t Balau::Handle::getMTime() { return -1; } ssize_t Balau::Handle::read(void * buf, size_t count) throw (GeneralException) { if (canRead()) - throw GeneralException(String("Handle ") + getName() + " can read, but read() not implemented (missing in class " + typeid(*this).name() + ")"); + throw GeneralException(String("Handle ") + getName() + " can read, but read() not implemented (missing in class " + ClassName(this).c_str() + ")"); else throw GeneralException("Handle can't read"); return -1; @@ -63,7 +63,7 @@ ssize_t Balau::Handle::read(void * buf, size_t count) throw (GeneralException) { ssize_t Balau::Handle::write(const void * buf, size_t count) throw (GeneralException) { if (canWrite()) - throw GeneralException(String("Handle ") + getName() + " can write, but write() not implemented (missing in class " + typeid(this).name() + ")"); + throw GeneralException(String("Handle ") + getName() + " can write, but write() not implemented (missing in class " + ClassName(this).c_str() + ")"); else throw GeneralException("Handle can't write"); return -1; @@ -71,7 +71,7 @@ ssize_t Balau::Handle::write(const void * buf, size_t count) throw (GeneralExcep 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 " + typeid(this).name() + ")"); + throw GeneralException(String("Handle ") + getName() + " can seek, but rseek() not implemented (missing in class " + ClassName(this).c_str() + ")"); else throw GeneralException("Handle can't seek"); } @@ -82,7 +82,7 @@ void Balau::Handle::wseek(off_t offset, int whence) throw (GeneralException) { off_t Balau::Handle::rtell() throw (GeneralException) { if (canSeek()) - throw GeneralException(String("Handle ") + getName() + " can seek, but rtell() not implemented (missing in class " + typeid(this).name() + ")"); + throw GeneralException(String("Handle ") + getName() + " can seek, but rtell() not implemented (missing in class " + ClassName(this).c_str() + ")"); else throw GeneralException("Handle can't seek"); } @@ -143,11 +143,13 @@ off_t Balau::SeekableHandle::rtell() throw (GeneralException) { Assert(canRead() || canWrite()); if (!canRead()) return wtell(); + return m_rOffset; } off_t Balau::SeekableHandle::wtell() throw (GeneralException) { Assert(canRead() || canWrite()); if (!canWrite()) return rtell(); + return m_wOffset; } -- cgit v1.2.3