diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CopyJob.cc | 15 | ||||
-rw-r--r-- | lib/Handle.cc | 12 | ||||
-rw-r--r-- | lib/Makefile.am | 2 | ||||
-rw-r--r-- | lib/ReadJob.cc | 16 |
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; + } +} |