diff options
Diffstat (limited to 'generic/Handle.cpp')
-rw-r--r-- | generic/Handle.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/generic/Handle.cpp b/generic/Handle.cpp index e95a28a..4e318c6 100644 --- a/generic/Handle.cpp +++ b/generic/Handle.cpp @@ -30,6 +30,10 @@ int Handle::GetHandle() { return h; } +int Handle::GetHandle() const { + return h; +} + ssize_t Handle::write(const void *buf, size_t count) throw (GeneralException) { ssize_t r, tr = 0; bool done, full = false; @@ -96,11 +100,11 @@ ssize_t Handle::read(void *buf, size_t count) throw (GeneralException) { return r; } -bool Handle::IsClosed(void) { +bool Handle::IsClosed(void) const { return closed; } -bool Handle::IsNonBlock(void) { +bool Handle::IsNonBlock(void) const { return nonblock; } @@ -177,27 +181,27 @@ void Handle::close() throw (GeneralException) { closed = 1; } -bool Handle::CanRead(void) { +bool Handle::CanRead(void) const { return false; } -bool Handle::CanWrite(void) { +bool Handle::CanWrite(void) const { return false; } -String Handle::GetName(void) { +String Handle::GetName(void) const { return _("Bare Handle - should not happend"); } -ssize_t Handle::GetSize(void) { +ssize_t Handle::GetSize(void) const { return -1; } -time_t Handle::GetModif(void) { +time_t Handle::GetModif(void) const { return -1; } -bool Handle::CanWatch(void) { +bool Handle::CanWatch(void) const { return true; } @@ -241,7 +245,11 @@ ssize_t Handle::uwrite(const void * buf, size_t count) throw (GeneralException) if (z) { itell += count; // cerr << "Performing gzwrite of " << count << " byte for handle " << h << endl; +#ifdef HAVE_CLEAN_ZLIB int err = gzwrite(zfile, buf, count); +#else + int err = gzwrite(zfile, (char *) buf, count); +#endif // cerr << "gzwrite returned " << err << endl; if (err == 0) { const char * m = gzerror(zfile, &err); @@ -286,11 +294,11 @@ ssize_t Handle::uread(void * buf, size_t count) { } } -off_t Handle::tell() { +off_t Handle::tell() const { return itell; } -bool Handle::CanSeek() { +bool Handle::CanSeek() const { return 0; } |