summaryrefslogtreecommitdiff
path: root/src/Util.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-05-26 20:25:38 +0000
committerDana Jansens <danakj@orodu.net>2002-05-26 20:25:38 +0000
commit0305cbdc3ae8525c74b2bb9b23884035549e3407 (patch)
treeb7eafbfbc759adeed8731227bd7f6cedd3f5ed05 /src/Util.cc
parent60b2990e397faccd6a2f4f1cf7f2285e45fb1876 (diff)
add Configuration class for generic configuration data load/save-ing.
use Configuration class throughout code. no longer save rc file on exit, save when any options are changed.
Diffstat (limited to 'src/Util.cc')
-rw-r--r--src/Util.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Util.cc b/src/Util.cc
index 0300e52b..a97ffe50 100644
--- a/src/Util.cc
+++ b/src/Util.cc
@@ -220,3 +220,24 @@ timeval normalizeTimeval(const timeval &tm) {
return ret;
}
+
+
+string itostring(unsigned long i) {
+ if (i == 0)
+ return string("0");
+
+ string tmp;
+ for (; i > 0; i /= 10)
+ tmp.insert(tmp.begin(), "0123456789"[i%10]);
+ return tmp;
+}
+
+
+string itostring(long i) {
+ if (i < 0) {
+ std::string tmp = itostring( (unsigned long) -i);
+ tmp.insert(tmp.begin(), '-');
+ return tmp;
+ } else
+ return itostring( (unsigned long) i);
+}