diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-08-25 15:25:56 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-08-25 15:25:56 +0200 |
commit | 8f9a5b76761885e908df60af1d0a9d3146b7689c (patch) | |
tree | 3c7d235e9516eafa5ac9202498c28f513fa5ba80 /inc | |
parent | 3008b32dd0f78b0b2c09e05a7b47080c7cb75d38 (diff) | |
download | abrt-8f9a5b76761885e908df60af1d0a9d3146b7689c.tar.gz abrt-8f9a5b76761885e908df60af1d0a9d3146b7689c.tar.xz abrt-8f9a5b76761885e908df60af1d0a9d3146b7689c.zip |
move to_string() helper to abrtlib.h
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'inc')
-rw-r--r-- | inc/abrtlib.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/inc/abrtlib.h b/inc/abrtlib.h index 5cde2cb9..1cac10c0 100644 --- a/inc/abrtlib.h +++ b/inc/abrtlib.h @@ -38,6 +38,8 @@ #include <grp.h> /* C++ bits */ #include <string> +#include <sstream> +#include <iostream> /* Some libc's forget to declare these, do it ourself */ extern char **environ; @@ -106,7 +108,6 @@ void xstat(const char *name, struct stat *stat_buf); void xmove_fd(int from, int to); char* xasprintf(const char *format, ...); -std::string ssprintf(const char *format, ...); int xopen(const char *pathname, int flags); int xopen3(const char *pathname, int flags, int mode); @@ -116,6 +117,18 @@ off_t copyfd_eof(int src_fd, int dst_fd); off_t copyfd_size(int src_fd, int dst_fd, off_t size); void copyfd_exact_size(int src_fd, int dst_fd, off_t size); +/* C++ style stuff */ + +std::string ssprintf(const char *format, ...); std::string get_home_dir(int uid); +template <class T> +std::string +to_string( T x ) +{ + std::ostringstream o; + o << x; + return o.str(); +} + #endif |