From eafe336a8e5580bbd76546970351956810f01d8f Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 7 Feb 2010 23:08:53 +0100 Subject: *: 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 --- inc/abrtlib.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'inc/abrtlib.h') 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 /* C++ bits */ #include -#include -#include #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 -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); -- cgit