summaryrefslogtreecommitdiff
path: root/lib/String.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/String.cc')
-rw-r--r--lib/String.cc14
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/String.cc b/lib/String.cc
index 062587d..510a84e 100644
--- a/lib/String.cc
+++ b/lib/String.cc
@@ -10,12 +10,10 @@
char ** gruikptr;
-#ifdef USE_DATE
extern "C" {
double dateCalc(char *, char *);
int isDateArgument(char *);
}
-#endif
char String::t[BUFSIZ + 1];
@@ -86,8 +84,7 @@ String::String(unsigned int i) {
siz = ::strlen(str);
}
-#ifdef USE_LONG_LONG
-String::String(long long l) {
+String::String(int64 l) {
char t[40];
sprintf(t, "%lld", l);
@@ -95,14 +92,13 @@ String::String(long long l) {
siz = ::strlen(str);
}
-String::String(unsigned long long l) {
+String::String(uint64 l) {
char t[40];
sprintf(t, "%llu", l);
str = Base::strdup(t);
siz = ::strlen(str);
}
-#endif
String::String(double d) {
char t[30];
@@ -321,12 +317,10 @@ int String::strchrcnt(char c) const {
return cnt;
}
-#ifdef USE_DATE
String String::to_sqldate(void) const {
/* DD/MM/YYYY ==> YYYYMMMDD */
return (is_date() ? extract(6, 9) + extract(3, 4) + extract(0, 1) : "");
}
-#endif
String String::to_sqltime(void) const {
/* h:m ==> h * 60 + m */
@@ -334,12 +328,10 @@ String String::to_sqltime(void) const {
return (is_time() ? String(extract(0, p - 1).to_int() * 60 + extract(p + 1).to_int()) : "");
}
-#ifdef USE_DATE
String String::from_sqldate(void) const {
/* YYYYMMDD ==> DD/MM/YYYY */
return ((strlen() == 8) && is_number() ? extract(6, 7) + '/' + extract(4, 5) + '/' + extract(0, 3) : "");
}
-#endif
String String::from_sqltime(void) const {
/* t ==> (t / 60):(t % 60) */
@@ -347,7 +339,6 @@ String String::from_sqltime(void) const {
return (is_number() ? String((int) (t / 60)) + ':' + (t % 60) : "");
}
-#ifdef USE_DATE
bool String::is_date(void) const {
/* 'DD/MM/YYYY'
0123456789 */
@@ -372,7 +363,6 @@ double String::datedif(const String & s) const {
return -1;
}
-#endif
bool String::is_number(void) const {
for (size_t i = ((str[0] == '-') ? 1 : 0); i < siz; i++) {