summaryrefslogtreecommitdiffstats
path: root/inc
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
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')
-rw-r--r--inc/ABRTException.h18
-rw-r--r--inc/CrashTypesSocket.h3
-rw-r--r--inc/abrt_types.h3
-rw-r--r--inc/abrtlib.h13
4 files changed, 26 insertions, 11 deletions
diff --git a/inc/ABRTException.h b/inc/ABRTException.h
index dc18132e..b826bfa8 100644
--- a/inc/ABRTException.h
+++ b/inc/ABRTException.h
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2010 ABRT team
+ Copyright (C) 2010 RedHat Inc
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
#ifndef ABRTEXCEPTION_H_
#define ABRTEXCEPTION_H_
diff --git a/inc/CrashTypesSocket.h b/inc/CrashTypesSocket.h
index db3ee44e..85f14567 100644
--- a/inc/CrashTypesSocket.h
+++ b/inc/CrashTypesSocket.h
@@ -17,8 +17,7 @@
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+*/
#ifndef SOCKETCRASHTYPES_H_
#define SOCKETCRASHTYPES_H_
diff --git a/inc/abrt_types.h b/inc/abrt_types.h
index d096ddd5..ae22b03d 100644
--- a/inc/abrt_types.h
+++ b/inc/abrt_types.h
@@ -15,8 +15,7 @@
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+*/
#ifndef ABRT_TYPES_H_
#define ABRT_TYPES_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 <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);