Lines Matching full:fmt

7 The {fmt} library API consists of the following parts:
9 * :ref:`fmt/core.h <core-api>`: the core API providing argument handling
11 * :ref:`fmt/format.h <format-api>`: the full format API providing compile-time
14 * :ref:`fmt/ranges.h <ranges-api>`: additional formatting support for ranges
16 * :ref:`fmt/chrono.h <chrono-api>`: date and time formatting
17 * :ref:`fmt/compile.h <compile-api>`: format string compilation
18 * :ref:`fmt/color.h <color-api>`: terminal color and text style
19 * :ref:`fmt/ostream.h <ostream-api>`: ``std::ostream`` support
20 * :ref:`fmt/printf.h <printf-api>`: ``printf`` formatting
22 All functions and types provided by the library reside in namespace ``fmt`` and
30 ``fmt/core.h`` defines the core API which provides argument handling facilities
32 include ``fmt/format.h`` instead of ``fmt/core.h``.
51 .. doxygenfunction:: fmt::format_to(OutputIt, const S&, Args&&...)
52 .. doxygenfunction:: fmt::format_to_n(OutputIt, size_t, const S&, const Args&...)
53 .. doxygenfunction:: fmt::formatted_size(string_view, Args&&...)
66 .. doxygenfunction:: fmt::arg(const S&, const T&)
78 #include <fmt/format.h>
80 void vlog(const char* file, int line, fmt::string_view format,
81 fmt::format_args args) {
82 fmt::print("{}: {}: ", file, line);
83 fmt::vprint(format, args);
89 fmt::make_args_checked<Args...>(format, args...));
100 .. doxygenfunction:: fmt::make_args_checked(const S&, const remove_reference_t<Args>&...)
102 .. doxygenfunction:: fmt::make_format_args(const Args&...)
104 .. doxygenclass:: fmt::format_arg_store
107 .. doxygenclass:: fmt::dynamic_format_arg_store
110 .. doxygenclass:: fmt::basic_format_args
113 .. doxygenstruct:: fmt::format_args
115 .. doxygenclass:: fmt::basic_format_arg
121 .. doxygenclass:: fmt::basic_string_view
124 .. doxygentypedef:: fmt::string_view
125 .. doxygentypedef:: fmt::wstring_view
134 #include <fmt/core.h>
138 auto s = fmt::format("{:L}", 1000000); // s == "1,000,000"
145 ``fmt/format.h`` defines the full format API providing compile-time format
165 #include <fmt/format.h>
170 struct fmt::formatter<point> {
181 // fmt::format("{:f} - point of interest", point{1, 2});
216 std::string s = fmt::format("{:f}", p);
224 template <> struct fmt::formatter<color>: formatter<string_view> {
243 fmt::format("{:>10}", color::blue)
250 #include <fmt/format.h>
262 struct fmt::formatter<T, std::enable_if_t<std::is_base_of<A, T>::value, char>> :
263 fmt::formatter<std::string> {
266 return fmt::formatter<std::string>::format(a.name(), ctx);
273 fmt::print("{}", a); // prints "B"
280 .. doxygenclass:: fmt::basic_format_parse_context
286 .. doxygenfunction:: fmt::format_to(OutputIt, const S&, Args&&...)
287 .. doxygenfunction:: fmt::format_to_n(OutputIt, size_t, const S&, const Args&...)
288 .. doxygenstruct:: fmt::format_to_n_result
294 The following user-defined literals are defined in ``fmt/format.h``.
303 .. doxygenstruct:: fmt::is_char
305 .. doxygentypedef:: fmt::char_t
307 .. doxygenfunction:: fmt::ptr(const T *)
308 .. doxygenfunction:: fmt::ptr(const std::unique_ptr<T>&)
309 .. doxygenfunction:: fmt::ptr(const std::shared_ptr<T>&)
311 .. doxygenfunction:: fmt::to_string(const T&)
313 .. doxygenfunction:: fmt::to_wstring(const T&)
315 .. doxygenfunction:: fmt::to_string_view(const Char *)
317 .. doxygenfunction:: fmt::join(Range&&, string_view)
319 .. doxygenfunction:: fmt::join(It, Sentinel, string_view)
321 .. doxygenclass:: fmt::detail::buffer
324 .. doxygenclass:: fmt::basic_memory_buffer
331 fmt does not use ``errno`` to communicate errors to the user, but it may call
335 .. doxygenclass:: fmt::system_error
338 .. doxygenfunction:: fmt::format_system_error
340 .. doxygenclass:: fmt::windows_error
346 The {fmt} library supports custom dynamic memory allocators.
348 :class:`fmt::basic_memory_buffer`::
351 fmt::basic_memory_buffer<char, fmt::inline_buffer_size, custom_allocator>;
359 custom_string vformat(custom_allocator alloc, fmt::string_view format_str,
360 fmt::format_args args) {
362 fmt::vformat_to(buf, format_str, args);
368 fmt::string_view format_str,
370 return vformat(alloc, format_str, fmt::make_format_args(args...));
385 #include <fmt/ranges.h>
389 fmt::print("{}", t);
392 NOTE: currently, the overload of ``fmt::join`` for iterables exists in the main
395 Using ``fmt::join``, you can separate tuple elements with a custom separator::
397 #include <fmt/ranges.h>
401 fmt::print("{}", fmt::join(t, ", "));
412 #include <fmt/chrono.h>
416 fmt::print("The date is {:%Y-%m-%d}.", fmt::localtime(t));
426 ``fmt/compile.h`` provides format string compilation support when using
442 ``fmt/color.h`` provides support for terminal color and text style output.
451 ``fmt/ostream.h`` provides ``std::ostream`` support including formatting of
454 #include <fmt/ostream.h>
466 std::string s = fmt::format("The date is {}", date(2012, 12, 9));
476 The header ``fmt/printf.h`` provides ``printf``-like formatting functionality.
480 counterparts, the ``fmt`` functions are type-safe and throw an exception if an
494 {fmt} implements nearly all of the `C++20 formatting library
498 * Names are defined in the ``fmt`` namespace instead of ``std`` to avoid