|
yast2-core
|
00001 /*---------------------------------------------------------------------\ 00002 | | 00003 | __ __ ____ _____ ____ | 00004 | \ \ / /_ _/ ___|_ _|___ \ | 00005 | \ V / _` \___ \ | | __) | | 00006 | | | (_| |___) || | / __/ | 00007 | |_|\__,_|____/ |_| |_____| | 00008 | | 00009 | core system | 00010 | (C) SuSE GmbH | 00011 \----------------------------------------------------------------------/ 00012 00013 File: toString.h 00014 00015 Author: Mathias Kettner <kettner@suse.de> 00016 Maintainer: Thomas Roelz <tom@suse.de> 00017 00018 /-*/ 00019 // -*- c++ -*- 00020 00021 /* 00022 * String conversion functions 00023 * 00024 * Author: Mathias Kettner <kettner@suse.de> 00025 */ 00026 00027 #ifndef toString_h 00028 #define toString_h 00029 00030 #include <string> 00031 #include <stdlib.h> 00032 #include <string.h> 00033 #include <stdio.h> 00034 00035 using std::string; 00036 00037 00038 inline string toString(int d) 00039 { 00040 char s[32]; 00041 snprintf(s, 32, "%d", d); 00042 return string(s); 00043 } 00044 00045 00046 inline string toString(long ld) 00047 { 00048 char s[32]; 00049 snprintf(s, 32, "%ld", ld); 00050 return string(s); 00051 } 00052 00053 inline string toString(long long Ld) 00054 { 00055 char s[32]; 00056 snprintf(s, 32, "%Ld", Ld); 00057 return string(s); 00058 } 00059 00060 #endif // toString_h 00061
1.7.3