summaryrefslogtreecommitdiffstats
path: root/inc/abrtlib.h
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-02-07 23:08:53 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-02-07 23:08:53 +0100
commiteafe336a8e5580bbd76546970351956810f01d8f (patch)
tree131b770ca194f2d840208ae9e52ee650b12e75e0 /inc/abrtlib.h
parent5ddcae3c61341e655e98470ceb26dda91b013704 (diff)
downloadabrt-eafe336a8e5580bbd76546970351956810f01d8f.tar.gz
abrt-eafe336a8e5580bbd76546970351956810f01d8f.tar.xz
abrt-eafe336a8e5580bbd76546970351956810f01d8f.zip
*: remove all usages of C++ streams (-10k in code size)
Also add copyright banners to all files which were missing them Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'inc/abrtlib.h')
-rw-r--r--inc/abrtlib.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/inc/abrtlib.h b/inc/abrtlib.h
index 6b1db552..5e0dc462 100644
--- a/inc/abrtlib.h
+++ b/inc/abrtlib.h
@@ -39,8 +39,6 @@
#include <grp.h>
/* C++ bits */
#include <string>
-#include <sstream>
-#include <iostream>
#include "abrt_types.h"
@@ -261,13 +259,14 @@ double get_dirsize_find_largest_dir(
std::string *worst_dir = NULL,
const char *excluded = NULL);
+std::string unsigned_to_string(unsigned long long x);
+std::string signed_to_string(long long x);
template <class T>
-std::string
-to_string(T x)
+std::string to_string(T x)
{
- std::ostringstream o;
- o << x;
- return o.str();
+ if (T(~T(0)) < T(0)) /* T is a signed type */
+ return unsigned_to_string(x);
+ return signed_to_string(x);
}
void parse_args(const char *psArgs, vector_string_t& pArgs, int quote = -1);