10 #ifndef META_PRINTING_H_
11 #define META_PRINTING_H_
30 for (
auto it = number.rbegin(); it != number.rend(); ++it, ++counter)
32 if (counter != 0 && counter != number.size() && counter % 3 == 0)
46 return "\033[32m" + str +
"\033[0m";
55 return "\033[31m" + str +
"\033[0m";
64 return "\033[1m" + str +
"\033[22m";
74 std::string units =
"bytes";
75 for (
auto& u : {
"KB",
"MB",
"GB",
"TB"})
77 if (num_bytes >= 1024)
84 num_bytes =
static_cast<double>(
static_cast<int>(num_bytes * 100)) / 100;
85 return std::to_string(num_bytes) +
" " + units;
95 const std::string& prefix =
"")
98 LOG(
progress) << prefix << static_cast<double>(idx) / max * 100
108 LOG(
progress) << prefix <<
"100% \n" << ENDLG;
109 LOG(info) << prefix <<
"100%" << ENDLG;
void freq(const std::string &file, const cpptoml::table &, uint16_t n)
Performs frequency analysis on a text file.
Definition: profile.cpp:276