diff --git a/src/Sicobject.H b/src/Sicobject.H index 760b7cc..3ba8779 100644 --- a/src/Sicobject.H +++ b/src/Sicobject.H @@ -2,6 +2,8 @@ #include #include +#include +#include #include #include "Sicmaster.H" @@ -44,7 +46,7 @@ class Sicobject std::string bytesize_string() { - + std::ostringstream strm( std::ios_base::ate); int i = 0; size_t size = _size; const char* units[] = {"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"}; @@ -53,9 +55,8 @@ class Sicobject i++; } assert(i < 9); - std::string output = "" ;//FIXME... muss mittagessen gehen -// do this c++11 style: sprintf(buf, "%.*f %s", i, size, units[i]); - return output; + strm << size << units[i]; + return strm.str(); }