From 0305cbdc3ae8525c74b2bb9b23884035549e3407 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 26 May 2002 20:25:38 +0000 Subject: 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. --- src/Util.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/Util.cc') 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); +} -- cgit v1.2.3