|
autotier
Automatic Tiering Fuse Filesystem
|
Use this class for byte-formatted values. e.g.: "123 KiB". More...
#include <Bytes.hpp>

Public Types | |
| enum | PrefixType { BINARY, SI } |
| typedef off64_t | bytes_type |
| Type to store number of bytes. | |
Public Member Functions | |
| Bytes (const std::string &str) | |
| Construct a new Bytes object from formatted string. More... | |
| Bytes (bytes_type bytes) | |
| Construct a new Bytes object from integral type. More... | |
| Bytes (void) | |
| Construct a new empty Bytes object. More... | |
| Bytes (const Bytes &other) | |
| Copy construct a new Bytes object. More... | |
| Bytes (Bytes &&other) | |
| Move constructor. More... | |
| Bytes & | operator= (const Bytes &other) |
| Copy assignment. More... | |
| Bytes & | operator= (Bytes &&other) |
| Assignment move constructor. More... | |
| ~Bytes ()=default | |
| Destroy the Bytes object. | |
| virtual bytes_type | get (void) const |
| Get value in bytes. More... | |
| std::string | get_str (enum PrefixType prefix_type=BINARY, int precision=2) const |
| Get value as formatted string. More... | |
| void | set (bytes_type val) |
| Set value from integral type. More... | |
| void | set (const std::string &str) |
| Set value from formatted string /\d+(.\d*)?\s*[kmgtpezy]?i?b/i. More... | |
| Bytes & | operator+= (const Bytes &other) |
| Bytes & | operator-= (const Bytes &other) |
Protected Member Functions | |
| bytes_type | parse_bytes (const std::string &str) const |
| Parse bytes from string. More... | |
Protected Attributes | |
| bytes_type | bytes_ |
Friends | |
| std::ostream & | operator<< (std::ostream &os, Bytes const &bytes) |
| Stream insertion operator. More... | |
| std::istream & | operator>> (std::istream &is, Bytes &bytes) |
| Stream extraction operator. More... | |
| Bytes | operator+ (const Bytes &a, const Bytes &b) |
| Bytes | operator- (const Bytes &a, const Bytes &b) |
| Bytes | operator* (const Bytes &a, int b) |
| Bytes | operator* (int a, const Bytes &b) |
| Bytes | operator/ (const Bytes &a, int b) |
| double | operator/ (const Bytes &a, const Bytes &b) |
| bool | operator== (const Bytes &a, const Bytes &b) |
| bool | operator!= (const Bytes &a, const Bytes &b) |
| bool | operator< (const Bytes &a, const Bytes &b) |
| bool | operator> (const Bytes &a, const Bytes &b) |
| bool | operator<= (const Bytes &a, const Bytes &b) |
| bool | operator>= (const Bytes &a, const Bytes &b) |
Use this class for byte-formatted values. e.g.: "123 KiB".
| ffd::Bytes::Bytes | ( | const std::string & | str | ) |
Construct a new Bytes object from formatted string.
| str | formatted string for bytes |
|
inline |
Construct a new Bytes object from integral type.
| bytes |
|
inline |
Construct a new empty Bytes object.
|
inline |
|
inlinevirtual |
| std::string ffd::Bytes::get_str | ( | enum PrefixType | prefix_type = BINARY, |
| int | precision = 2 |
||
| ) | const |
Get value as formatted string.
| prefix_type | ffd::Bytes::PrefixType::BINARY for multiples of 1024, ffd::Bytes::PrefixType::SI for multiples of 1000. |
|
protected |
|
inline |
Set value from integral type.
| val |
|
inline |
Set value from formatted string /\d+(.\d*)?\s*[kmgtpezy]?i?b/i.
| str |
|
friend |
Stream insertion operator.
| os | |
| bytes |
|
friend |
Stream extraction operator.
| is | |
| bytes |
1.8.17