STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
utils.cpp File Reference
#include <stxxl/bits/common/types.h>
#include <stxxl/bits/common/utils.h>
#include <stxxl/bits/namespace.h>
#include <sstream>
#include <iomanip>

Go to the source code of this file.


 STXXL library namespace


std::string stxxl::format_IEC_size (uint64 number)
 Format a byte size using IEC (Ki, Mi, Gi, Ti) suffixes (powers of two). Returns "123 Ki" or similar. More...
std::string stxxl::format_SI_size (uint64 number)
 Format a byte size using SI (K, M, G, T) suffixes (powers of ten). Returns "123 M" or similar. More...
bool stxxl::parse_SI_IEC_size (const std::string &str, uint64 &size, char def_unit=0)
 Parse a string like "343KB" or "44 GiB" into the corresponding size in bytes. Returns the number of bytes and sets ok = true if the string could be parsed correctly. If no units indicator is given, use def_unit in k/m/g/t/p (powers of ten) or in K/M/G/T/P (power of two). More...