the stringstream is coming

master
john stone 9 years ago
parent dd2469778b
commit 1b5b8b7413

@ -2,6 +2,8 @@
#include <string>
#include <ctime>
#include <sstream>
#include <iostream>
#include <cassert>
#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();
}

Loading…
Cancel
Save