MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / getStorageUnit

Function getStorageUnit

Tactility/Source/app/systeminfo/SystemInfo.cpp:84–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82};
83
84static 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
97static std::string getStorageUnitString(StorageUnit unit) {
98 using enum StorageUnit;

Callers 1

updateMemoryBarFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected