Removed PrettyBytes function
This commit is contained in:
@@ -74,46 +74,4 @@ namespace OpenVulkano
|
||||
file.close();
|
||||
return data;
|
||||
}
|
||||
|
||||
std::string Utils::PrettyBytes(uint64_t bytes)
|
||||
{
|
||||
static const uint64_t TERABYTES = 1024ULL*1024*1024*1024;
|
||||
static const uint64_t GIGABYTES = 1024ULL*1024*1024;
|
||||
static const uint64_t MEGABYTES = 1024*1024;
|
||||
static const uint64_t KILOBYTES = 1024;
|
||||
|
||||
int TB, GB, MB, KB;
|
||||
TB = bytes / TERABYTES;
|
||||
bytes -= TB * TERABYTES;
|
||||
GB = bytes / GIGABYTES;
|
||||
bytes -= GB * GIGABYTES;
|
||||
MB = bytes / MEGABYTES;
|
||||
bytes -= MB * MEGABYTES;
|
||||
KB = bytes / KILOBYTES;
|
||||
bytes -= KB * KILOBYTES;
|
||||
|
||||
std::string result;
|
||||
if(TB)
|
||||
{
|
||||
result = std::to_string(TB) + " TB";
|
||||
}
|
||||
else if(GB)
|
||||
{
|
||||
result = std::to_string(GB) + " GB";
|
||||
}
|
||||
else if(MB)
|
||||
{
|
||||
result = std::to_string(MB) + " MB";
|
||||
}
|
||||
else if(KB)
|
||||
{
|
||||
result = std::to_string(KB) + " KB";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = std::to_string(bytes) + " B";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,6 +138,5 @@ namespace OpenVulkano
|
||||
}
|
||||
|
||||
static Array<char> ReadFile(const std::string& filePath, bool emptyOnMissing = false);
|
||||
static std::string PrettyBytes(uint64_t bytes);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user