summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/Buffer.h3
-rw-r--r--include/Makefile.am2
-rw-r--r--include/Regex.h7
-rw-r--r--lib/Buffer.cc15
-rw-r--r--lib/Makefile.am2
-rw-r--r--lib/Regex.cc1
6 files changed, 27 insertions, 3 deletions
diff --git a/include/Buffer.h b/include/Buffer.h
index c6bfcf4..cf57cb6 100644
--- a/include/Buffer.h
+++ b/include/Buffer.h
@@ -9,7 +9,7 @@
#define realloc_threshold 256
#endif
-class Buffer: public Handle {
+class Buffer : public Handle {
public:
Buffer();
~Buffer();
@@ -18,6 +18,7 @@ class Buffer: public Handle {
virtual bool CanRead();
virtual bool CanWrite();
virtual String GetName();
+ Buffer operator=(const Buffer &);
private:
char * buffer;
int realsiz, bufsiz, ptr;
diff --git a/include/Makefile.am b/include/Makefile.am
index 245640d..156307a 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1,4 +1,4 @@
include_HEADERS = \
Exceptions.h Handle.h String.h Output.h Socket.h HttpServ.h Variables.h Menu.h \
Action.h Message.h Form.h Confirm.h Table.h IRC.h Task.h Buffer.h General.h \
-CopyJob.h ReadJob.h
+CopyJob.h ReadJob.h Regex.h
diff --git a/include/Regex.h b/include/Regex.h
index 363be99..66f6fc3 100644
--- a/include/Regex.h
+++ b/include/Regex.h
@@ -2,6 +2,13 @@
#define __REGEX_H__
#ifdef __cplusplus
+#include <Exceptions.h>
+
+class Regex : public Base {
+ public:
+ private:
+};
+
#else
#error This only works with a C++ compiler
#endif
diff --git a/lib/Buffer.cc b/lib/Buffer.cc
index 57b1bf8..85445c6 100644
--- a/lib/Buffer.cc
+++ b/lib/Buffer.cc
@@ -53,3 +53,18 @@ bool Buffer::CanWrite() {
String Buffer::GetName() {
return "Buffer";
}
+
+Buffer Buffer::operator=(Buffer & b) {
+ if (b.buffer != buffer) {
+ free(buffer);
+ realsiz = b.realsiz;
+ ptr = b.ptr;
+ if ((bufsiz = b.bufsiz)) {
+ buffer = (char *) malloc(bufsiz);
+ memcpy(buffer, b.buffer, realsiz);
+ } else {
+ buffer = 0;
+ }
+ return *this;
+ }
+}
diff --git a/lib/Makefile.am b/lib/Makefile.am
index fe512b6..f5b1cfb 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\
- CopyJob.cc ReadJob.cc
+ CopyJob.cc ReadJob.cc Regex.cc
libBaltisot_la_LDFLAGS = -release $(Baltisot_VERSION_INFO)
diff --git a/lib/Regex.cc b/lib/Regex.cc
index e69de29..2ef2c8e 100644
--- a/lib/Regex.cc
+++ b/lib/Regex.cc
@@ -0,0 +1 @@
+#include "Regex.h" \ No newline at end of file