summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-10-10 23:09:53 -0700
committerPixel <pixel@nobis-crew.org>2011-10-10 23:31:07 -0700
commit67b6a78b347ab7ba269a52d772e79d12444f6e96 (patch)
tree5a105f61add7a5eaa8bd63a7182eecde84285b0e /src
parent8ae349b49e16064e4d84b6cfd256e3ca7fb0cd60 (diff)
Adding a few more features to Input, and actually creating a slightly better ClassName system, when using gcc and libstdc++.
Diffstat (limited to 'src')
-rw-r--r--src/Handle.cc10
-rw-r--r--src/Input.cc4
2 files changed, 10 insertions, 4 deletions
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;
}
diff --git a/src/Input.cc b/src/Input.cc
index ea078dc..09b2903 100644
--- a/src/Input.cc
+++ b/src/Input.cc
@@ -93,3 +93,7 @@ off_t Balau::Input::getSize() {
time_t Balau::Input::getMTime() {
return m_mtime;
}
+
+bool Balau::Input::canRead() {
+ return true;
+}