
#include "Util/sformat.H"#include <string>

Go to the source code of this file.
Classes | |
| class | ByteCount |
| A class to handle parsing + converting byte counts. More... | |
Functions | |
| std::string | convertToString (const ByteCount &val) |
| ByteCount overload: format is "<int>". | |
| void | convertFromString (const std::string &str, ByteCount &val) |
| ByteCount overload: format is "<float>[<B|KiB|MiB|GiB>]". | |
A class to handle byte counts, parsing them from strings, and converting between bytes, kibibytes, mebibytes, etc.
Definition in file ByteCount.H.
| void convertFromString | ( | const std::string & | str, | |
| ByteCount & | val | |||
| ) | [inline] |
ByteCount overload: format is "<float>[<B|KiB|MiB|GiB>]".
Definition at line 130 of file ByteCount.H.
| std::string convertToString | ( | const ByteCount & | val | ) | [inline] |
ByteCount overload: format is "<int>".
Note that we don't do any abbreviations to KiB, Mib, GiB, etc. on output, since that would involve a conversion to floating point that might result in data loss after a conversion to string and back. If you want such an abbreviated string, you can use ByteCount::prettyPrint().
Definition at line 124 of file ByteCount.H.
References ByteCount::bytes(), and sformat().
1.6.3