tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
basic_format_context.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_FORMAT_BASIC_FORMAT_CONTEXT_HPP
4#define TETL_FORMAT_BASIC_FORMAT_CONTEXT_HPP
5
8
9namespace etl {
10template <typename T, typename CharT>
11struct formatter;
12
20template <typename OutputIt, typename CharT>
22 using iterator = OutputIt;
23 using char_type = CharT;
24
25 explicit constexpr basic_format_context(OutputIt pos) noexcept
26 : _pos{pos}
27 {
28 }
29
30 template <typename T>
32
34 [[nodiscard]] constexpr auto out() noexcept -> iterator { return _pos; }
35
38 constexpr auto advance_to(iterator it) noexcept -> void { _pos = it; }
39
40private:
41 OutputIt _pos;
42};
43
57
58} // namespace etl
59
60#endif // TETL_FORMAT_BASIC_FORMAT_CONTEXT_HPP
Definition adjacent_find.hpp:8
basic_format_context< back_insert_iterator< detail::fmt_buffer< wchar_t > >, wchar_t > wformat_context
Definition basic_format_context.hpp:56
basic_format_context< back_insert_iterator< detail::fmt_buffer< char > >, char > format_context
Provides access to formatting state consisting of the formatting arguments and the output iterator.
Definition basic_format_context.hpp:55
Provides access to formatting state consisting of the formatting arguments and the output iterator.
Definition basic_format_context.hpp:21
CharT char_type
Definition basic_format_context.hpp:23
constexpr basic_format_context(OutputIt pos) noexcept
Definition basic_format_context.hpp:25
constexpr auto advance_to(iterator it) noexcept -> void
Sets the output iterator to it. After a call to advance_to, subsequent calls to out() will return a c...
Definition basic_format_context.hpp:38
OutputIt iterator
Definition basic_format_context.hpp:22
formatter< T, CharT > formatter_type
Definition basic_format_context.hpp:31
constexpr auto out() noexcept -> iterator
Returns the iterator to the output buffer.
Definition basic_format_context.hpp:34
The enabled specializations of formatter define formatting rules for a given type....
Definition formatter.hpp:19