SlHelpers
Loading...
Searching...
No Matches
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, ...).

Detailed Description

A helper to convert units.

Member Function Documentation

◆ human()

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:
  • /home/abuild/rpmbuild/BUILD/slhelpers-20260428.f233ce9-build/slhelpers-20260428.f233ce9/include/helpers/Misc.h