summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorpixel <pixel>2003-02-13 22:45:44 +0000
committerpixel <pixel>2003-02-13 22:45:44 +0000
commit9683c7b1f67c75670714397c46338c5b2f9b4dc8 (patch)
tree7b257dc9f65e0eb17c74b98c123bdf63a715bcc0 /include
parent383a1ae79222f971bc9245d9c6f35b5db3e28c8b (diff)
Supporting GMP
Diffstat (limited to 'include')
-rw-r--r--include/BString.h7
-rw-r--r--include/GMPString.h18
-rw-r--r--include/Makefile.am2
3 files changed, 22 insertions, 5 deletions
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 <string.h>
+#include <stdarg.h>
#include <iostream>
#include <string>
#include <Exceptions.h>
@@ -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 <gmpxx.h>
+#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