00001
00011 #ifndef _INTTOSTR_HH_
00012 #define _INTTOSTR_HH_
00013
00014 #include <sstream>
00015 #include <cstring>
00016
00017 #ifndef DOXYGEN_PROCESSING
00018 namespace divine
00019 {
00020 #endif //DOXYGEN_PROCESSING
00021
00022 template<typename T>
00023 static inline char * create_string_from(T i)
00024 {
00025 std::ostringstream o;
00026 o << i;
00027 size_t size = 1 + o.str().size();
00028 char *auxstr = new char[size];
00029 memset(auxstr, 0, size);
00030 strncpy(auxstr, o.str().c_str(), size);
00031 return auxstr;
00032 }
00033
00034 void dispose_string(char * const str);
00035
00036 #ifndef DOXYGEN_PROCESSING
00037 };
00038 #endif
00039
00040 #endif