wrench::UnitParser
-
class wrench::UnitParser
A class used to part string specification of values with units into a single value (e.g., “2KB” -> 2048 bytes, “2Kb” -> 256 bytes)
Public Static Functions
-
static double parse_compute_speed(std::string string)
Given a string compute speed specification with units (e.g., “3f”, “10Gf”) return the size in bytes.
- Parameters
string – the size specification
- Throws
std::invalid_argument –
- Returns
the size in bytes
-
static double parse_size(std::string string)
Given a string size specification with units (e.g., “13Mb”) return the size in bytes.
- Parameters
string – the size specification
- Throws
std::invalid_argument –
- Returns
the size in bytes
-
static double parse_compute_speed(std::string string)