wrench::UnitParser Class Reference

A class used to part string specification of values with units into a single value (e.g., "2KB" -> 2048 bytes, "2Kb" -> 256 bytes) More...

#include <UnitParser.h>

Static Public Member 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. More...
 
static double parse_size (std::string string)
 Given a string size specification with units (e.g., "13Mb") return the size in bytes. More...
 

Detailed Description

A class used to part string specification of values with units into a single value (e.g., "2KB" -> 2048 bytes, "2Kb" -> 256 bytes)

Member Function Documentation

◆ parse_compute_speed()

double wrench::UnitParser::parse_compute_speed ( std::string  string)
static

Given a string compute speed specification with units (e.g., "3f", "10Gf") return the size in bytes.

Parameters
stringthe size specification
Returns
the size in bytes
Exceptions
std::invalid_argument

◆ parse_size()

double wrench::UnitParser::parse_size ( std::string  string)
static

Given a string size specification with units (e.g., "13Mb") return the size in bytes.

Parameters
stringthe size specification
Returns
the size in bytes
Exceptions
std::invalid_argument

The documentation for this class was generated from the following files: