microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Classes | Namespaces | Enumerations | Functions
units.hpp File Reference

SI, byte-size, and unit-suffixed formatting views. More...

#include "../microfmt.hpp"
#include <cstdint>
#include <string_view>
#include <type_traits>
Include dependency graph for units.hpp:

Go to the source code of this file.

Classes

struct  microfmt::auto_unit_view< T >
 
struct  microfmt::unit_view< T >
 
struct  microfmt::formatter< unit_view< T > >
 
struct  microfmt::formatter< auto_unit_view< T > >
 

Namespaces

namespace  microfmt
 

Enumerations

enum class  microfmt::scale_base : uint16_t { microfmt::decimal = 1000 , microfmt::binary = 1024 }
 

Functions

template<typename T , std::enable_if_t< std::is_integral_v< T >, int > = 0>
constexpr auto microfmt::auto_si (T val, microfmt::string_view unit, uint8_t precision=2) noexcept
 
template<typename T , std::enable_if_t< std::is_integral_v< T >, int > = 0>
constexpr auto microfmt::auto_bytes (T bytes, uint8_t precision=2) noexcept
 
template<typename T >
constexpr auto microfmt::with_unit (T val, microfmt::string_view unit) noexcept
 
template<typename T , std::enable_if_t< std::is_integral_v< T >, int > = 0>
constexpr auto microfmt::hertz (T hz, uint8_t precision=2) noexcept
 

Detailed Description

SI, byte-size, and unit-suffixed formatting views.