summaryrefslogtreecommitdiff
path: root/generic/Handle.cpp
diff options
context:
space:
mode:
authorPixel <Pixel>2002-09-27 12:17:57 +0000
committerPixel <Pixel>2002-09-27 12:17:57 +0000
commitbfa5de7eccf4604ff8217f619e9685a09e80d545 (patch)
treea5be5de750ac611145f459a09bda902c3dbc1a70 /generic/Handle.cpp
parent60c1003845035ad4cd0e9ea50862bad7626faf0e (diff)
The week-without-the-network changes
Diffstat (limited to 'generic/Handle.cpp')
-rw-r--r--generic/Handle.cpp28
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;
}