40 using type =
typename S::char_type;
50 std::use_facet<std::numpunct<wchar_t>>(loc.get<std::locale>());
51 auto separator = std::wstring();
72 static constexpr int num_static_named_args =
76 Char,
static_cast<int>(
sizeof...(T)), num_static_named_args,
92 FMT_ENABLE_IF(std::is_base_of<detail::compile_string, S>::value&&
93 std::is_same<typename S::char_type, Char>::value)>
106template <
typename Char,
typename... T>
109template <
typename... T>
119template <
typename... T>
121 ->
decltype(fmt::make_format_args<wformat_context>(args...)) {
122 return fmt::make_format_args<wformat_context>(args...);
125#if !FMT_USE_NONTYPE_TEMPLATE_ARGS
133template <
typename It,
typename Sentinel>
136 return {begin, end, sep};
139template <
typename Range, FMT_ENABLE_IF(!is_tuple_like<Range>::value)>
141 ->
join_view<
decltype(std::begin(range)),
decltype(std::end(range)),
143 return join(std::begin(range), std::end(range), sep);
149 return join(std::begin(list), std::end(list), sep);
152template <
typename Tuple, FMT_ENABLE_IF(is_tuple_like<Tuple>::value)>
158template <
typename Char, FMT_ENABLE_IF(!std::is_same<Char,
char>::value)>
161 -> std::basic_string<Char> {
164 return {buf.data(), buf.size()};
167template <
typename... T>
169 return vformat(fmt::wstring_view(fmt), fmt::make_wformat_args(args...));
172template <
typename OutputIt,
typename... T>
175 return vformat_to(out, fmt::wstring_view(fmt),
176 fmt::make_wformat_args(args...));
181template <
typename S,
typename... T,
184 !std::is_same<Char, wchar_t>::value)>
185auto format(
const S& fmt, T&&... args) -> std::basic_string<Char> {
190template <
typename Locale,
typename S,
194inline auto vformat(
const Locale& loc,
const S& fmt,
196 -> std::basic_string<Char> {
200 return {buf.data(), buf.size()};
203template <
typename Locale,
typename S,
typename... T,
207inline auto format(
const Locale& loc,
const S& fmt, T&&... args)
208 -> std::basic_string<Char> {
213template <
typename OutputIt,
typename S,
224template <
typename OutputIt,
typename S,
typename... T,
227 !std::is_same<Char, char>::value &&
228 !std::is_same<Char, wchar_t>::value)>
229inline auto format_to(OutputIt out,
const S& fmt, T&&... args) -> OutputIt {
234template <
typename Locale,
typename S,
typename OutputIt,
typename... Args,
239inline auto vformat_to(OutputIt out,
const Locale& loc,
const S& fmt,
247template <
typename Locale,
typename OutputIt,
typename S,
typename... T,
252inline auto format_to(OutputIt out,
const Locale& loc,
const S& fmt,
254 typename std::enable_if<enable, OutputIt>::type {
259template <
typename OutputIt,
typename Char,
typename... Args,
268 return {buf.out(), buf.count()};
271template <
typename OutputIt,
typename S,
typename... T,
275inline auto format_to_n(OutputIt out,
size_t n,
const S& fmt, T&&... args)
277 return vformat_to_n(out, n, fmt::basic_string_view<Char>(fmt),
281template <
typename S,
typename... T,
294 buf.push_back(L
'\0');
295 if (std::fputws(buf.data(), f) == -1)
300 vprint(stdout, fmt, args);
303template <
typename... T>
312template <
typename... T>
314 return print(f, L
"{}\n", fmt::format(fmt, std::forward<T>(args)...));
318 return print(L
"{}\n", fmt::format(fmt, std::forward<T>(args)...));
325 return {buf.data(), buf.size()};
328template <
typename... T>
331 return fmt::vformat(ts, fmt, fmt::make_wformat_args(args...));
334template <
typename... T>
337 vprint(f, ts, fmt, fmt::make_wformat_args(args...));
340template <
typename... T>
343 return print(stdout, ts, fmt, args...);
352template <
typename... T>
357template <
typename... T>
359 print(os, L
"{}\n", fmt::format(fmt, std::forward<T>(args)...));
363template <
typename T>
inline auto to_wstring(
const T& value) -> std::wstring {
An implementation of std::basic_string_view for pre-C++17.
Definition base.h:518
Parsing context consisting of a format string range being parsed and an argument counter for automati...
Definition base.h:866
A text style consisting of foreground and background colors and emphasis.
Definition color.h:236
detail namespace with internal helper functions
Definition input_adapters.h:32
auto get_iterator(Buf &buf, OutputIt) -> decltype(buf.out())
Definition base.h:2109
FMT_CONSTEXPR void ignore_unused(const T &...)
Definition base.h:363
constexpr auto count_static_named_args() -> int
Definition base.h:1062
constexpr auto count_named_args() -> int
Definition base.h:1059
typename std::enable_if< B, T >::type enable_if_t
Definition cpp_future.h:38
@ value
the parser finished reading a JSON value
typename format_string_char< S >::type format_string_char_t
Definition xchar.h:44
auto write_loc(OutputIt, const loc_value &, const format_specs &, locale_ref) -> bool
Definition format.h:1951
bool_constant<!std::is_same< T, char >::value > is_exotic_char
Definition xchar.h:27
FMT_CONSTEXPR void parse_format_string(basic_string_view< Char > fmt, Handler &&handler)
Definition base.h:1629
typename make_void< Ts... >::type void_t
Definition void_t.h:21
void write_buffer(std::basic_ostream< Char > &os, buffer< Char > &buf)
Definition ostream.h:55
typename V::value_type char_t
String's character (code unit) type. detail:: is intentional to prevent ADL.
Definition base.h:956
constexpr auto to_string_view(const Char *s) -> basic_string_view< Char >
Definition base.h:931
std::integral_constant< bool, Value > bool_constant
Definition type_traits.h:743
auto get_buffer(OutputIt out) -> iterator_buffer< OutputIt, T >
Definition base.h:2099
void vformat_to(buffer< Char > &buf, basic_string_view< Char > fmt, typename vformat_args< Char >::type args, locale_ref loc={})
Definition format.h:3769
Definition PointerIntPair.h:280
FMT_CONSTEVAL FMT_ALWAYS_INLINE basic_fstring(const S &s)
Definition xchar.h:87
basic_fstring(runtime_format_string< Char > fmt)
Definition xchar.h:100
FMT_ALWAYS_INLINE basic_fstring(const S &)
Definition xchar.h:94
auto get() const -> basic_string_view< Char >
Definition xchar.h:103
Definition format-inl.h:93
auto grouping() const -> std::string
Definition format-inl.h:94
auto thousands_sep() const -> Char
Definition format-inl.h:95
#define S(label, offset, message)
Definition Errors.h:113
#define FMT_END_EXPORT
Definition base.h:272
std::integral_constant< bool, B > bool_constant
Definition base.h:315
#define FMT_CONSTEVAL
Definition base.h:140
#define FMT_CONSTEXPR
Definition base.h:113
#define FMT_ALWAYS_INLINE
Definition base.h:251
#define FMT_BEGIN_NAMESPACE
Definition base.h:261
#define FMT_USE_CONSTEVAL
Definition base.h:118
#define FMT_ENABLE_IF(...)
Definition base.h:349
#define FMT_BEGIN_EXPORT
Definition base.h:271
std::is_constructible< formatter< T, Char > > FMT_DEPRECATED
Definition base.h:2801
#define FMT_END_NAMESPACE
Definition base.h:264
conditional_t< std::is_same< Char, char >::value, context, generic_context< basic_appender< Char >, Char > > buffered_context
Definition base.h:651
auto format(wformat_string< T... > fmt, T &&... args) -> std::wstring
Definition xchar.h:168
auto vformat_to_n(OutputIt out, size_t n, basic_string_view< Char > fmt, typename detail::vformat_args< Char >::type args) -> format_to_n_result< OutputIt >
Definition xchar.h:262
buffered_context< wchar_t > wformat_context
Definition xchar.h:64
auto formatted_size(const S &fmt, T &&... args) -> size_t
Definition xchar.h:284
auto vformat_to(OutputIt out, const S &fmt, typename detail::vformat_args< Char >::type args) -> OutputIt
Definition xchar.h:217
constexpr auto make_wformat_args(T &... args) -> decltype(fmt::make_format_args< wformat_context >(args...))
Definition xchar.h:120
basic_string_view< wchar_t > wstring_view
Definition xchar.h:62
auto format_to_n(OutputIt out, size_t n, const S &fmt, T &&... args) -> format_to_n_result< OutputIt >
Definition xchar.h:275
basic_memory_buffer< wchar_t > wmemory_buffer
Definition xchar.h:66
typename basic_format_string< wchar_t, T... >::t wformat_string
Definition xchar.h:110
auto format_to(OutputIt out, wformat_string< T... > fmt, T &&... args) -> OutputIt
Definition xchar.h:173
auto to_wstring(const T &value) -> std::wstring
Converts value to std::wstring using the default format for type T.
Definition xchar.h:363
auto join(It begin, Sentinel end, wstring_view sep) -> join_view< It, Sentinel, wchar_t >
Definition xchar.h:134
void print(std::FILE *f, wformat_string< T... > fmt, T &&... args)
Definition xchar.h:304
auto runtime(wstring_view s) -> runtime_format_string< wchar_t >
Definition xchar.h:111
void vprint(std::FILE *f, wstring_view fmt, wformat_args args)
Definition xchar.h:291
auto vformat(basic_string_view< Char > fmt, typename detail::vformat_args< Char >::type args) -> std::basic_string< Char >
Definition xchar.h:159
void println(std::FILE *f, wformat_string< T... > fmt, T &&... args)
Definition xchar.h:313