summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPixel <Pixel>2001-10-29 16:23:12 +0000
committerPixel <Pixel>2001-10-29 16:23:12 +0000
commita259ec553a1d685ebb976ec34eaaf700d24ee0c4 (patch)
treeca310bfa8858bc3d5a1602789ecbe41e9c2ca3dd /lib
parent2e5bed84841f33ff28dd95b77b555720c875a286 (diff)
More tasking implementation
Diffstat (limited to 'lib')
-rw-r--r--lib/CopyJob.cc15
-rw-r--r--lib/Handle.cc12
-rw-r--r--lib/Makefile.am2
-rw-r--r--lib/ReadJob.cc16
4 files changed, 44 insertions, 1 deletions
diff --git a/lib/CopyJob.cc b/lib/CopyJob.cc
index e69de29..7dccbc5 100644
--- a/lib/CopyJob.cc
+++ b/lib/CopyJob.cc
@@ -0,0 +1,15 @@
+#include "CopyJob.h"
+
+CopyJob::CopyJob(Handle & as, Handle & ad) : s(as), d(ad) { }
+
+CopyJob::~CopyJob() { }
+
+int CopyJob::Do() {
+ int r;
+ char buffer[4096];
+
+ while (!s.IsClosed()) {
+ r = s.read(buffer, 4096);
+ d.write(buffer, r);
+ }
+}
diff --git a/lib/Handle.cc b/lib/Handle.cc
index c3efc55..0f1791e 100644
--- a/lib/Handle.cc
+++ b/lib/Handle.cc
@@ -138,3 +138,15 @@ void Handle::close() {
closed = 1;
}
+
+bool Handle::CanRead(void) {
+ return false;
+}
+
+bool Handle::CanWrite(void) {
+ return false;
+}
+
+String Handle::GetName(void) {
+ return _("Bare Handle - should not happend");
+}
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 1135e12..01cef95 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -8,6 +8,6 @@ lib_LTLIBRARIES = libBaltisot.la
libBaltisot_la_SOURCES = Exceptions.cc Handle.cc Output.cc String.cc\
Socket.cc Input.cc HttpServ.cc Variables.cc Action.cc Menu.cc Message.cc\
Form.cc Confirm.cc Table.cc checkargs.c datecalc.c IRC.cc Task.cc Buffer.cc\
- Misc.cc
+ CopyJob.cc ReadJob.cc
libBaltisot_la_LDFLAGS = -release $(Baltisot_VERSION_INFO)
diff --git a/lib/ReadJob.cc b/lib/ReadJob.cc
new file mode 100644
index 0000000..9f4e084
--- /dev/null
+++ b/lib/ReadJob.cc
@@ -0,0 +1,16 @@
+#include "ReadJob.h"
+
+ReadJob::ReadJob(Handle & as, Handle & ad) : s(as), d(ad) { }
+
+ReadJob::~ReadJob() { }
+
+int ReadJob::Do() {
+ int r;
+ String buff;
+
+ while (!s.IsClosed()) {
+ buff << s;
+ buff >> d;
+ if (buff == "") return TASK_DONE;
+ }
+}