SlHelpers
SlHelpers::Unit Struct Reference

A helper to convert units. More...

#include <Misc.h>

Static Public Member Functions

static std::string human (const size_t bytes, const unsigned precision=2, const bool fixed=true) noexcept
 Convert bytes into human readable form (1 Kib, 20.5 MiB, ...) More...
 

Detailed Description

A helper to convert units.

Member Function Documentation

◆ human()

static std::string SlHelpers::Unit::human ( const size_t  bytes,
const unsigned  precision = 2,
const bool  fixed = true 
)
inlinestaticnoexcept

Convert bytes into human readable form (1 Kib, 20.5 MiB, ...)

Parameters
bytesValue to convert
precisionCount of numbers after a dot
fixedIf std::fixed should be used
Returns
Human readable form of bytes.

The documentation for this struct was generated from the following file: