| 335 | } |
| 336 | |
| 337 | std::wstring FormatBytes(size_t size) |
| 338 | { |
| 339 | static const wchar_t* units[] = { L"bytes", L"kB", L"MB", L"GB", L"TB", L"PB", L"EB", nullptr }; |
| 340 | const wchar_t** unit = units; |
| 341 | const int kb = 1024; |
| 342 | while (size / kb > 0 && unit[1] != nullptr) |
| 343 | { |
| 344 | size = size / kb; |
| 345 | ++unit; |
| 346 | } |
| 347 | |
| 348 | return wstringbuilder() << size << L" " << *unit; |
| 349 | } |
| 350 | |
| 351 | std::wstring CMainFrame::GetSelectionInfoText(const std::wstring& label, const SelectionInfo& selection) const |
| 352 | { |