diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-07 23:08:53 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-07 23:08:53 +0100 |
commit | eafe336a8e5580bbd76546970351956810f01d8f (patch) | |
tree | 131b770ca194f2d840208ae9e52ee650b12e75e0 /inc/abrtlib.h | |
parent | 5ddcae3c61341e655e98470ceb26dda91b013704 (diff) | |
download | abrt-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.h | 13 |
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); |