| 82 | }; |
| 83 | |
| 84 | static StorageUnit getStorageUnit(uint64_t value) { |
| 85 | using enum StorageUnit; |
| 86 | if (value / (1024 * 1024 * 1024) > 0) { |
| 87 | return Gigabytes; |
| 88 | } else if (value / (1024 * 1024) > 0) { |
| 89 | return Megabytes; |
| 90 | } else if (value / 1024 > 0) { |
| 91 | return Kilobytes; |
| 92 | } else { |
| 93 | return Bytes; |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | static std::string getStorageUnitString(StorageUnit unit) { |
| 98 | using enum StorageUnit; |