3#ifndef TETL_FORMAT_FORMATTER_HPP
4#define TETL_FORMAT_FORMATTER_HPP
18template <
typename T,
typename CharT =
char>
28 template <
typename FormatContext>
29 constexpr auto format(
char val, FormatContext& fc) ->
decltype(fc.out())
39 template <
typename FormatContext>
40 constexpr auto format(
char const* val, FormatContext& fc) ->
decltype(fc.out())
46template <etl::
size_t N>
48 template <
typename FormatContext>
49 constexpr auto format(
char const* val, FormatContext& fc) ->
decltype(fc.out())
57 template <
typename FormatContext>
64template <etl::
size_t Capacity>
66 template <
typename FormatContext>
74template <
typename Integer,
typename FormatContext>
75constexpr auto integer_format(Integer v, FormatContext& fc) ->
decltype(fc.out())
81 return formatter<string_view>().format(str, fc);
83 return formatter<string_view>().format(
"", fc);
89 template <
typename FormatContext>
90 constexpr auto format(
short v, FormatContext& fc) ->
decltype(fc.out())
92 return detail::integer_format(v, fc);
98 template <
typename FormatContext>
99 constexpr auto format(
int v, FormatContext& fc) ->
decltype(fc.out())
101 return detail::integer_format(v, fc);
107 template <
typename FormatContext>
108 constexpr auto format(
long v, FormatContext& fc) ->
decltype(fc.out())
110 return detail::integer_format(v, fc);
116 template <
typename FormatContext>
117 constexpr auto format(
long long v, FormatContext& fc) ->
decltype(fc.out())
119 return detail::integer_format(v, fc);
125 template <
typename FormatContext>
126 constexpr auto format(
unsigned short v, FormatContext& fc) ->
decltype(fc.out())
128 return detail::integer_format(v, fc);
134 template <
typename FormatContext>
135 constexpr auto format(
int v, FormatContext& fc) ->
decltype(fc.out())
137 return detail::integer_format(v, fc);
143 template <
typename FormatContext>
144 constexpr auto format(
unsigned long v, FormatContext& fc) ->
decltype(fc.out())
146 return detail::integer_format(v, fc);
152 template <
typename FormatContext>
153 constexpr auto format(
unsigned long long v, FormatContext& fc) ->
decltype(fc.out())
155 return detail::integer_format(v, fc);
constexpr auto copy(InputIt first, InputIt last, OutputIt destination) -> OutputIt
Copies the elements in the range, defined by [first, last), to another range beginning at destination...
Definition copy.hpp:18
constexpr auto strlen(char const *str) -> etl::size_t
Returns the length of the C string str.
Definition strlen.hpp:13
constexpr auto end(C &c) -> decltype(c.end())
Returns an iterator to the end (i.e. the element after the last element) of the given container c or ...
Definition end.hpp:14
constexpr auto begin(C &c) -> decltype(c.begin())
Returns an iterator to the beginning of the given container c or array array. These templates rely on...
Definition begin.hpp:20
basic_string_view< char, etl::char_traits< char > > string_view
Typedef for common character type char
Definition basic_string_view.hpp:704
@ none
Definition from_integer.hpp:20
constexpr auto from_integer(Int num, char *str, size_t length, int base) -> from_integer_result
Definition from_integer.hpp:30
Definition adjacent_find.hpp:8
basic_inplace_string< char, Capacity > inplace_string
Typedef for a basic_inplace_string using 'char'.
Definition basic_inplace_string.hpp:1330