From 34c6ea80ecb40d65e6b0da40efad5239356bb497 Mon Sep 17 00:00:00 2001 From: pixel Date: Mon, 23 Dec 2002 16:30:11 +0000 Subject: String.h --> BString.h --- include/BString.h | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ include/Confirm.h | 2 +- include/Exceptions.h | 2 +- include/Form.h | 2 +- include/Handle.h | 2 +- include/HttpServ.h | 2 +- include/IRC.h | 1 + include/Input.h | 2 +- include/Makefile.am | 2 +- include/Menu.h | 2 +- include/Message.h | 2 +- include/Output.h | 2 +- include/Regex.h | 2 +- include/Socket.h | 2 +- include/String.h | 69 ---------------------------------------------------- include/Table.h | 2 +- include/Variables.h | 2 +- 17 files changed, 84 insertions(+), 83 deletions(-) create mode 100644 include/BString.h delete mode 100644 include/String.h (limited to 'include') diff --git a/include/BString.h b/include/BString.h new file mode 100644 index 0000000..948534e --- /dev/null +++ b/include/BString.h @@ -0,0 +1,69 @@ +#ifndef __STRING_H__ +#define __STRING_H__ + +#include +#include +#include +#include + +class String : public Base { + public: + String(const String &); + String(const char * = ""); +#if 0 + String(const char * = "", ...); +#endif + String(char); + String(int); + String(unsigned int); + String(int64); + String(uint64); + String(double); + ~String(); + const char * set(const char *, ...); + const char * set(const String &, ...); + 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; + double to_double() const; + String to_sqldate() const; + String to_sqltime() const; + String from_sqldate() const; + String from_sqltime() const; + double datedif(const String &) const; + bool is_date() const; + bool is_number() const; + bool is_float() const; + bool is_time() const; + size_t strlen() const; + ssize_t strchr(char, size_t = 0) const; + ssize_t strrchr(char) const; + ssize_t strstr(const String &) const; + int strchrcnt(char) const; + String & operator=(const String &); + String operator+(const String &) const; + String & operator+=(const String &); + bool operator!=(const String &) const; + bool operator==(const String &) const; + bool operator<=(const String &) const; + bool operator>=(const String &) const; + bool operator<(const String &) const; + bool operator>(const String &) const; + char operator[](size_t i) const; + String & toupper(); + String & tolower(); + + private: + String(int hs, char *); + static char t[]; + char * str, * ostr; + size_t siz; +}; + +std::ostream & operator<<(std::ostream &, const String &); +std::istream & operator>>(std::istream &, String &); + +String operator+(const char *, const String &); + +#endif diff --git a/include/Confirm.h b/include/Confirm.h index 3e215d3..ef1dabc 100644 --- a/include/Confirm.h +++ b/include/Confirm.h @@ -2,7 +2,7 @@ #define __CONFIRM_H__ #include -#include +#include #include class Confirm : public Action { diff --git a/include/Exceptions.h b/include/Exceptions.h index c9756c9..576f757 100644 --- a/include/Exceptions.h +++ b/include/Exceptions.h @@ -97,6 +97,6 @@ class Exit : public GeneralException { int code; }; -#include +#include #endif diff --git a/include/Form.h b/include/Form.h index b12e2b5..f0fa93f 100644 --- a/include/Form.h +++ b/include/Form.h @@ -2,7 +2,7 @@ #define __FORM_H__ #include -#include +#include #include class Form : public Action { diff --git a/include/Handle.h b/include/Handle.h index 920a634..998c126 100644 --- a/include/Handle.h +++ b/include/Handle.h @@ -6,7 +6,7 @@ #include #include -#include +#include #include class Handle : public Base { diff --git a/include/HttpServ.h b/include/HttpServ.h index a0dd958..fc58246 100644 --- a/include/HttpServ.h +++ b/include/HttpServ.h @@ -2,7 +2,7 @@ #define __HTTPSERV_H__ #include -#include +#include #include #include #include diff --git a/include/IRC.h b/include/IRC.h index 285d9bf..6823b21 100644 --- a/include/IRC.h +++ b/include/IRC.h @@ -3,6 +3,7 @@ #include #include +#include #define RPL_WELCOME 1 #define RPL_YOURHOST 2 diff --git a/include/Input.h b/include/Input.h index 80bd73e..bb740b0 100644 --- a/include/Input.h +++ b/include/Input.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include class Input : public Handle { diff --git a/include/Makefile.am b/include/Makefile.am index 8f7579a..c8c5036 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,5 +1,5 @@ pkginclude_HEADERS = \ -Exceptions.h Handle.h String.h Output.h Socket.h HttpServ.h Variables.h Menu.h \ +Exceptions.h Handle.h BString.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 generic.h \ CopyJob.h ReadJob.h Regex.h TaskMan.h InPipe.h OutPipe.h Input.h Image.h \ Main.h Color.h diff --git a/include/Menu.h b/include/Menu.h index 461f5e2..91e1459 100644 --- a/include/Menu.h +++ b/include/Menu.h @@ -2,7 +2,7 @@ #define __MENU_H__ #include -#include +#include #include class Menu : public Action { diff --git a/include/Message.h b/include/Message.h index 2ee28e3..01c59da 100644 --- a/include/Message.h +++ b/include/Message.h @@ -2,7 +2,7 @@ #define __MESSAGE_H__ #include -#include +#include #include class Message : public Action { diff --git a/include/Output.h b/include/Output.h index 9e83845..3d97922 100644 --- a/include/Output.h +++ b/include/Output.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include class Output : public Handle { diff --git a/include/Regex.h b/include/Regex.h index ce62028..b076342 100644 --- a/include/Regex.h +++ b/include/Regex.h @@ -2,7 +2,7 @@ #define __REGEX_H__ #include -#include +#include #include class Regex : public Base { diff --git a/include/Socket.h b/include/Socket.h index 055e512..245ed9e 100644 --- a/include/Socket.h +++ b/include/Socket.h @@ -2,7 +2,7 @@ #define __SOCKET_H__ #include -#include +#include #include #include #include diff --git a/include/String.h b/include/String.h deleted file mode 100644 index 948534e..0000000 --- a/include/String.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef __STRING_H__ -#define __STRING_H__ - -#include -#include -#include -#include - -class String : public Base { - public: - String(const String &); - String(const char * = ""); -#if 0 - String(const char * = "", ...); -#endif - String(char); - String(int); - String(unsigned int); - String(int64); - String(uint64); - String(double); - ~String(); - const char * set(const char *, ...); - const char * set(const String &, ...); - 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; - double to_double() const; - String to_sqldate() const; - String to_sqltime() const; - String from_sqldate() const; - String from_sqltime() const; - double datedif(const String &) const; - bool is_date() const; - bool is_number() const; - bool is_float() const; - bool is_time() const; - size_t strlen() const; - ssize_t strchr(char, size_t = 0) const; - ssize_t strrchr(char) const; - ssize_t strstr(const String &) const; - int strchrcnt(char) const; - String & operator=(const String &); - String operator+(const String &) const; - String & operator+=(const String &); - bool operator!=(const String &) const; - bool operator==(const String &) const; - bool operator<=(const String &) const; - bool operator>=(const String &) const; - bool operator<(const String &) const; - bool operator>(const String &) const; - char operator[](size_t i) const; - String & toupper(); - String & tolower(); - - private: - String(int hs, char *); - static char t[]; - char * str, * ostr; - size_t siz; -}; - -std::ostream & operator<<(std::ostream &, const String &); -std::istream & operator>>(std::istream &, String &); - -String operator+(const char *, const String &); - -#endif diff --git a/include/Table.h b/include/Table.h index 58336d0..c972fa3 100644 --- a/include/Table.h +++ b/include/Table.h @@ -2,7 +2,7 @@ #define __TABLE_H__ #include -#include +#include #include class Table : public Action { diff --git a/include/Variables.h b/include/Variables.h index 2bbc406..ac4ef58 100644 --- a/include/Variables.h +++ b/include/Variables.h @@ -2,7 +2,7 @@ #define __VARIABLES_H__ #include -#include +#include #include #include -- cgit v1.2.3