make beautifyFileSize public

This general function will be useful in other kiwix apps
This commit is contained in:
Nikhil Tanwar 2023-07-19 20:38:05 +05:30
parent cb74c9c7c7
commit 5c3a997de4
2 changed files with 9 additions and 1 deletions

View File

@ -216,5 +216,14 @@ std::map<std::string, std::string> getNetworkInterfaces();
*/
std::string getBestPublicIp();
/** Converts file size to human readable format.
*
* This function will convert a number to its equivalent size using units.
*
* @param number file size in bytes.
* @return a human-readable string representation of the size, e.g., "2.3 KB", "1.8 MB", "5.2 GB".
*/
std::string beautifyFileSize(uint64_t number);
}
#endif // KIWIX_TOOLS_H

View File

@ -31,7 +31,6 @@
namespace kiwix
{
std::string beautifyInteger(uint64_t number);
std::string beautifyFileSize(uint64_t number);
void printStringInHexadecimal(const char* s);
void printStringInHexadecimal(icu::UnicodeString s);
void stringReplacement(std::string& str,