Expand the values of the size mapping

This commit is contained in:
Francisco Javier Jurado Moreno 2024-05-27 11:44:32 +02:00
parent 6db2a42d19
commit 28640e4323

View File

@ -27,20 +27,20 @@ const std::unordered_map<std::string_view, UInt64> size_unit_to_bytes =
{
{"b", 1},
// ISO/IEC 80000-13 binary units
{"kib", 1024}, // 1024
{"mib", 1048576}, // 1024 * 1024
{"gib", 1073741824}, // 1024 * 1024 * 1024
{"tib", 1099511627776}, // 1024 * 1024 * 1024 * 1024
{"pib", 1125899906842624}, // 1024 * 1024 * 1024 * 1024 * 1024
{"eib", 1152921504606846976}, // 1024 * 1024 * 1024 * 1024 * 1024 * 1024
{"kib", 1024},
{"mib", 1024 * 1024},
{"gib", 1024 * 1024 * 1024},
{"tib", 1024 * 1024 * 1024 * 1024},
{"pib", 1024 * 1024 * 1024 * 1024 * 1024},
{"eib", 1024 * 1024 * 1024 * 1024 * 1024 * 1024},
// SI units
{"kb", 1000}, // 10e3
{"mb", 1000000}, // 10e6
{"gb", 1000000000}, // 10e9
{"tb", 1000000000000}, // 10e12
{"pb", 1000000000000000}, // 10e15
{"eb", 1000000000000000000}, // 10e18
{"kb", 1000},
{"mb", 1000 * 1000},
{"gb", 1000 * 1000 * 1000},
{"tb", 1000 * 1000 * 1000 * 1000},
{"pb", 1000 * 1000 * 1000 * 1000 * 1000},
{"eb", 1000 * 1000 * 1000 * 1000 * 1000 * 1000},
};
constexpr UInt64 MAX_UINT64 = std::numeric_limits<UInt64>::max();