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

FreeBSD `bintime` and `sbintime_t` time formatting views. More...

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

Go to the source code of this file.

Classes

struct  microfmt::detail::is_bintime_struct< T, typename >
 
struct  microfmt::detail::is_bintime_struct< T, std::void_t< decltype(std::declval< T >().sec), decltype(std::declval< T >().frac)> >
 
struct  microfmt::is_bintime< T >
 Customization point trait detecting FreeBSD-style binary time types. More...
 
struct  microfmt::formatter< T, std::enable_if_t< is_bintime_v< T > > >
 Formatter for any type satisfying is_bintime_v. More...
 
struct  microfmt::sbintime_view< T >
 Non-owning view disambiguating an sbintime_t value from a plain int64_t. More...
 
struct  microfmt::formatter< sbintime_view< T > >
 Formatter for sbintime_view values. More...
 

Namespaces

namespace  microfmt
 
namespace  microfmt::detail
 

Enumerations

enum class  microfmt::time_precision : uint8_t {
  microfmt::sec = 0 , microfmt::ms = 3 , microfmt::us = 6 , microfmt::ns = 9 ,
  microfmt::ps = 12
}
 Fractional-second precision selectors for time formatting. More...
 

Functions

uint64_t microfmt::detail::bintime_frac_to_decimal (uint64_t frac, time_precision prec) noexcept
 Converts a bintime fractional part into decimal-scaling digits.
 
uint32_t microfmt::detail::sbintime_frac_to_decimal (uint32_t frac32, time_precision prec) noexcept
 Converts an sbintime_t fractional part into decimal-scaling digits.
 
template<typename T , typename = std::enable_if_t<std::is_integral_v<T>>>
constexpr auto microfmt::as_sbintime (T val) noexcept
 Wraps an integral sbintime_t value in an sbintime_view.
 

Variables

template<typename T >
constexpr bool microfmt::is_bintime_v = is_bintime<std::remove_cv_t<std::remove_reference_t<T>>>::value
 Convenience variable template for is_bintime.
 

Detailed Description

FreeBSD `bintime` and `sbintime_t` time formatting views.