|
fmt
|
Support for formatting into and from std::ostream. More...
#include "fmt/macros.hpp"#include <cerrno>#include <climits>#include <limits.h>#include <stdint.h>#include <stdio.h>#include <string.h>#include <version>import fmt:chrono;import std;Typedefs | |
| using | fmt::OstreamFormatter = BasicOstreamFormatter<char> |
Functions | |
| template<typename Char> | |
| auto | fmt::detail::writeBuffer (std::basic_ostream< Char > &os, Buffer< Char > &buf) -> void |
| template<typename T> | |
| constexpr auto | fmt::streamed (const T &value) -> detail::StreamedView< T > |
| auto | fmt::vprint (std::ostream &os, StringView fmt, FormatArgs args) -> void |
| template<typename... T> | |
| auto | fmt::print (std::ostream &os, FormatString< T... > fmt, T &&... args) -> void |
| template<typename... T> | |
| auto | fmt::println (std::ostream &os, FormatString< T... > fmt, T &&... args) -> void |
Support for formatting into and from std::ostream.
Interface partition fmt:ostream.
| using fmt::OstreamFormatter = BasicOstreamFormatter<char> |
basic_ostream_formatter for char.
|
export |
Prints formatted data to the stream os.
Example:
fmt::print(cerr, "Don't {}!", "panic");
|
export |
Prints formatted data to the stream os, followed by a newline.
Example:
fmt::println(cerr, "Don't {}!", "panic");
|
constexpr |
Returns a view that formats value via an ostream operator<<.
Example:
fmt::print("Current thread id: {}\n",
fmt::streamed(std::this_thread::get_id()));
| auto fmt::vprint | ( | std::ostream & | os, |
| StringView | fmt, | ||
| FormatArgs | args ) -> void |
Writes the already-formatted arguments args to the stream os.
This is the type-erased form of print: it takes FormatArgs rather than a parameter pack, so it can be called from a function that is not itself a template. On Windows a stream backed by a console is written to directly, so that Unicode is preserved.
| auto fmt::detail::writeBuffer | ( | std::basic_ostream< Char > & | os, |
| Buffer< Char > & | buf ) -> void |
Writes the content of buf to os, in chunks no larger than std::streamsize can express.
A separate function rather than a part of vprint to simplify testing.