LLVM 23.0.0git
llvm::format_provider< std::chrono::duration< Rep, Period > > Struct Template Reference

Implementation of format_provider<T> for duration types. More...

#include "llvm/Support/Chrono.h"

Inheritance diagram for llvm::format_provider< std::chrono::duration< Rep, Period > >:
[legend]

Static Public Member Functions

static void format (const Dur &D, llvm::raw_ostream &Stream, StringRef Style)

Detailed Description

template<typename Rep, typename Period>
struct llvm::format_provider< std::chrono::duration< Rep, Period > >

Implementation of format_provider<T> for duration types.

The options string of a duration type has the grammar:

duration_options ::= [unit][show_unit [number_options]] unit ::= h|m|s|ms|us|ns / show_unit ::= + | -` number_options ::= options string for a integral or floating point type

Examples

| options | Input | Output |

| "" | 1s | 1 s | | "ms" | 1s | 1000 ms | | "ms-" | 1s | 1000 | | "ms-n" | 1s | 1,000 |

| "" | 1.0s | 1.00 s |

If the unit of the duration type is not one of the units specified above, it is still possible to format it, provided you explicitly request a display unit or you request that the unit is not displayed.

Definition at line 151 of file Chrono.h.

Member Function Documentation

◆ format()

template<typename Rep, typename Period>
void llvm::format_provider< std::chrono::duration< Rep, Period > >::format ( const Dur & D,
llvm::raw_ostream & Stream,
StringRef Style )
inlinestatic

Definition at line 193 of file Chrono.h.

References assert(), llvm::count(), D(), and llvm::StringRef::empty().


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