From aa92df3c58daefb994da555fb45f2e3ee55f38d5 Mon Sep 17 00:00:00 2001 From: Pixel Date: Wed, 14 Nov 2001 16:59:02 +0000 Subject: Latest and various changes --- include/HttpServ.h | 2 +- include/Input.h | 11 +++++++++++ include/Makefile.am | 4 ++-- include/Output.h | 21 +++++++++++++++++++++ include/String.h | 4 ++-- include/Task.h | 3 ++- include/TaskMan.h | 13 ++++++------- 7 files changed, 45 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/HttpServ.h b/include/HttpServ.h index 5074639..7ac40e2 100644 --- a/include/HttpServ.h +++ b/include/HttpServ.h @@ -18,7 +18,7 @@ class HttpServ : public Base { public: - HttpServ(int = 1500, const String & = String("GruiK Server v0.1")); + HttpServ(int = 1500, const String & = String("GruiK Server v0.1")) throw (GeneralException); ~HttpServ() {} void MainLoop(Action *); private: diff --git a/include/Input.h b/include/Input.h index f9a3df5..682cee1 100644 --- a/include/Input.h +++ b/include/Input.h @@ -20,6 +20,17 @@ class Input : public Handle { String n; }; +class Stdin_t : public Handle { + public: + Stdin_t(); + virtual ~Stdin_t() {} + virtual bool CanWrite(); + virtual bool CanRead(); + virtual String GetName(); +}; + +extern Stdin_t Stdin; + #else #error This only works with a C++ compiler #endif diff --git a/include/Makefile.am b/include/Makefile.am index ac1f63c..bc93b8d 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,5 +1,5 @@ -includedir = $(prefix)/include/@PACKAGE@ -include_HEADERS = \ +#includedir = $(prefix)/include/@PACKAGE@ +pkginclude_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 Regex.h TaskMan.h diff --git a/include/Output.h b/include/Output.h index ef76012..4e1e092 100644 --- a/include/Output.h +++ b/include/Output.h @@ -20,6 +20,27 @@ class Output : public Handle { String n; }; +class Stdout_t : public Handle { + public: + Stdout_t(); + virtual ~Stdout_t() {} + virtual bool CanWrite(); + virtual bool CanRead(); + virtual String GetName(); +}; + +class Stderr_t : public Handle { + public: + Stderr_t(); + virtual ~Stderr_t() {} + virtual bool CanWrite(); + virtual bool CanRead(); + virtual String GetName(); +}; + +extern Stdout_t Stdout; +extern Stderr_t Stderr; + #else #error This only works with a C++ compiler #endif diff --git a/include/String.h b/include/String.h index c6afdb2..ddb0cde 100644 --- a/include/String.h +++ b/include/String.h @@ -47,8 +47,8 @@ class String : public Base { String(int); String(double); ~String(); - char * set(char *, ...); - char * to_charp(size_t = 0, ssize_t = -1) const; + const char * set(char *, ...); + const char * to_charp(size_t = 0, ssize_t = -1) const; String extract(size_t = 0, ssize_t = -1) const; char * strdup(size_t = 0, ssize_t = -1) const; int to_int() const; diff --git a/include/Task.h b/include/Task.h index 675b2ed..f2d4b0b 100644 --- a/include/Task.h +++ b/include/Task.h @@ -3,6 +3,7 @@ #ifdef __cplusplus #include +#include #include #include #include @@ -31,7 +32,7 @@ class Task : public Base { vector w4ha; vector w4ta; vector w4pr; - vector w4to; + vector w4to; }; #else diff --git a/include/TaskMan.h b/include/TaskMan.h index dc8c913..16bc0ee 100644 --- a/include/TaskMan.h +++ b/include/TaskMan.h @@ -7,14 +7,13 @@ class TaskMan : public Base { public: - TaskMan() throw (GeneralException); - int AddTask(Task *); - int TaskMan::RemoveTask(Task *); - void Init() throw (GeneralException); - void MainLoop() throw (GeneralException); + static int AddTask(Task *); + static int RemoveTask(Task *); + static void Init() throw (GeneralException); + static void MainLoop() throw (GeneralException); private: - vector TaskList; - int number; + static vector TaskList; + static int number; static bool inited; }; -- cgit v1.2.3