From 9683c7b1f67c75670714397c46338c5b2f9b4dc8 Mon Sep 17 00:00:00 2001 From: pixel Date: Thu, 13 Feb 2003 22:45:44 +0000 Subject: Supporting GMP --- include/BString.h | 7 +++---- include/GMPString.h | 18 ++++++++++++++++++ include/Makefile.am | 2 +- 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 include/GMPString.h (limited to 'include') diff --git a/include/BString.h b/include/BString.h index 8dd71c5..ab4f5e5 100644 --- a/include/BString.h +++ b/include/BString.h @@ -2,6 +2,7 @@ #define __STRING_H__ #include +#include #include #include #include @@ -15,9 +16,6 @@ class String : public Base { public: String(const String &); String(const char * = ""); -#if 0 - String(const char * = "", ...); -#endif String(char); String(int); String(unsigned int); @@ -25,6 +23,7 @@ class String : public Base { String(uint64); String(double); ~String(); + const char * set(const char *, va_list); const char * set(const char *, ...); const char * set(const ugly_string &, ...); int scanf(const char *, ...) const; @@ -65,7 +64,7 @@ class String : public Base { private: String(int hs, char *); static char t[]; - char * str, * ostr; + char * str; size_t siz; }; diff --git a/include/GMPString.h b/include/GMPString.h new file mode 100644 index 0000000..77364bf --- /dev/null +++ b/include/GMPString.h @@ -0,0 +1,18 @@ +#ifndef __GMPSTRING_H__ +#define __GMPSTRING_H__ +#include +#include "BString.h" + +class GMPString : public Base { + public: + GMPString(const GMPString &); + GMPString(const mpz_class &); + GMPString(const mpq_class &); + GMPString(const mpf_class &); + ~GMPString(); + operator String() const; + private: + char * str; +}; + +#endif diff --git a/include/Makefile.am b/include/Makefile.am index c8c5036..583a97d 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -2,6 +2,6 @@ pkginclude_HEADERS = \ 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 +Main.h Color.h GMPString.h noinst_HEADERS = gettext.h -- cgit v1.2.3