MCPcopy Create free account
hub / github.com/CobaltFusion/DebugViewPP / FormatBytes

Function FormatBytes

DebugView++/MainFrame.cpp:337–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335}
336
337std::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
351std::wstring CMainFrame::GetSelectionInfoText(const std::wstring& label, const SelectionInfo& selection) const
352{

Callers 1

UpdateStatusBarMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected