25#if FMT_HAS_INCLUDE(<version>)
29#if FMT_CPLUSPLUS >= 201703L
30# if FMT_HAS_INCLUDE(<filesystem>)
33# if FMT_HAS_INCLUDE(<variant>)
36# if FMT_HAS_INCLUDE(<optional>)
42#if FMT_HAS_INCLUDE(<cxxabi.h>) || defined(__GLIBCXX__)
46# ifndef __GABIXX_CXXABI_H__
47# define FMT_HAS_ABI_CXA_DEMANGLE
54# if defined(__GXX_RTTI) || FMT_HAS_FEATURE(cxx_rtti) || FMT_MSC_VERSION || \
55 defined(__INTEL_RTTI__) || defined(__RTTI)
56# define FMT_USE_TYPEID 1
58# define FMT_USE_TYPEID 0
62#ifdef __cpp_lib_filesystem
67template <
typename Char>
auto get_path_string(
const std::filesystem::path& p) {
68 return p.string<Char>();
71template <
typename Char>
73 const std::filesystem::path& p) {
74 write_escaped_string<Char>(std::back_inserter(quoted), p.string<Char>());
79inline auto get_path_string<char>(
const std::filesystem::path& p) {
85 const std::filesystem::path& p) {
87 write_escaped_string<wchar_t>(std::back_inserter(buf), p.native());
94inline void write_escaped_path<std::filesystem::path::value_type>(
96 const std::filesystem::path& p) {
97 write_escaped_string<std::filesystem::path::value_type>(
98 std::back_inserter(quoted), p.native());
104template <
typename Char>
struct formatter<
std::filesystem::path, Char> {
113 template <
typename ParseContext>
FMT_CONSTEXPR auto parse(ParseContext& ctx) {
114 auto it = ctx.begin(), end = ctx.end();
115 if (it == end)
return it;
118 if (it == end)
return it;
121 if (it != end && *it ==
'?') {
128 template <
typename FormatContext>
129 auto format(
const std::filesystem::path& p, FormatContext& ctx)
const {
131 detail::handle_dynamic_spec<detail::width_checker>(specs.width, width_ref_,
134 auto s = detail::get_path_string<Char>(p);
138 detail::write_escaped_path(quoted, p);
149template <
typename Char>
153#ifdef __cpp_lib_optional
156template <
typename T,
typename Char>
169 ->
decltype(u.set_debug_format(
set)) {
170 u.set_debug_format(
set);
177 template <
typename ParseContext>
FMT_CONSTEXPR auto parse(ParseContext& ctx) {
179 return underlying_.parse(ctx);
182 template <
typename FormatContext>
183 auto format(std::optional<T>
const& opt, FormatContext& ctx)
const
184 ->
decltype(ctx.out()) {
185 if (!opt)
return detail::write<Char>(ctx.out(),
none);
187 auto out = ctx.out();
188 out = detail::write<Char>(out, optional);
190 out = underlying_.format(*opt, ctx);
197#ifdef __cpp_lib_variant
202using variant_index_sequence =
203 std::make_index_sequence<std::variant_size<T>::value>;
205template <
typename>
struct is_variant_like_ : std::false_type {};
206template <
typename... Types>
207struct is_variant_like_<
std::variant<Types...>> : std::true_type {};
210template <
typename T,
typename C>
class is_variant_formattable_ {
211 template <std::size_t... Is>
212 static std::conjunction<
214 check(std::index_sequence<Is...>);
217 static constexpr const bool value =
218 decltype(check(variant_index_sequence<T>{}))::value;
221template <
typename Char,
typename OutputIt,
typename T>
222auto write_variant_alternative(OutputIt out,
const T& v) -> OutputIt {
223 if constexpr (is_string<T>::value)
225 else if constexpr (std::is_same_v<T, Char>)
228 return write<Char>(out, v);
233template <
typename T>
struct is_variant_like {
234 static constexpr const bool value = detail::is_variant_like_<T>::value;
237template <
typename T,
typename C>
struct is_variant_formattable {
238 static constexpr const bool value =
239 detail::is_variant_formattable_<T, C>::value;
244 template <
typename ParseContext>
245 FMT_CONSTEXPR auto parse(ParseContext& ctx) ->
decltype(ctx.begin()) {
249 template <
typename FormatContext>
250 auto format(
const std::monostate&, FormatContext& ctx)
const
251 ->
decltype(ctx.out()) {
252 return detail::write<Char>(ctx.out(),
"monostate");
257template <
typename Variant,
typename Char>
261 is_variant_like<Variant>, is_variant_formattable<Variant, Char>>>> {
262 template <
typename ParseContext>
263 FMT_CONSTEXPR auto parse(ParseContext& ctx) ->
decltype(ctx.begin()) {
267 template <
typename FormatContext>
268 auto format(
const Variant& value, FormatContext& ctx)
const
269 ->
decltype(ctx.out()) {
270 auto out = ctx.out();
272 out = detail::write<Char>(out,
"variant(");
276 out = detail::write_variant_alternative<Char>(out, v);
280 FMT_CATCH(
const std::bad_variant_access&) {
281 detail::write<Char>(out,
"valueless by exception");
293 template <
typename ParseContext>
298 template <
typename FormatContext>
300 ->
decltype(ctx.out()) {
301 auto out = ctx.out();
303 out = detail::write<Char>(out, Char(
':'));
304 out = detail::write<Char>(out, ec.value());
310template <
typename T,
typename Char>
313 typename
std::enable_if<std::is_base_of<std::exception, T>::value>
::type> {
315 bool with_typename_ =
false;
319 ->
decltype(ctx.begin()) {
320 auto it = ctx.begin();
321 auto end = ctx.end();
322 if (it == end || *it ==
'}')
return it;
330 template <
typename OutputIt>
334 auto out = ctx.out();
339 const std::type_info& ti =
typeid(ex);
340# ifdef FMT_HAS_ABI_CXA_DEMANGLE
342 std::size_t size = 0;
343 std::unique_ptr<char,
decltype(&
std::free)> demangled_name_ptr(
344 abi::__cxa_demangle(ti.name(),
nullptr, &size, &status), &
std::free);
347 if (demangled_name_ptr) {
348 demangled_name_view = demangled_name_ptr.get();
358 char* begin = demangled_name_ptr.get();
359 char* to = begin + 5;
360 for (
char *
from = to, *end = begin + demangled_name_view.
size();
363 if (
from[0] ==
'_' &&
from[1] ==
'_') {
364 char* next =
from + 1;
365 while (next < end && *next !=
':') next++;
366 if (next[0] ==
':' && next[1] ==
':') {
379# elif FMT_MSC_VERSION
383 else if (demangled_name_view.
starts_with(
"struct "))
398template <
typename T,
typename Enable =
void>
407 std::is_convertible<T, bool>::value &&
411#ifdef _LIBCPP_VERSION
417 static constexpr const bool value =
true;
428template <
typename BitRef,
typename Char>
432 template <
typename FormatContext>
434 ->
decltype(ctx.out()) {
440template <
typename T,
typename Char>
444 template <
typename FormatContext>
445 auto format(
const std::atomic<T>& v, FormatContext& ctx)
const
446 ->
decltype(ctx.out()) {
451#ifdef __cpp_lib_atomic_flag_test
453template <
typename Char>
456 template <
typename FormatContext>
457 auto format(
const std::atomic_flag& v, FormatContext& ctx)
const
458 ->
decltype(ctx.out()) {
and restrictions which apply to each piece of software is included later in this file and or inside of the individual applicable source files The disclaimer of warranty in the WPILib license above applies to all code in and nothing in any of the other licenses gives permission to use the names of FIRST nor the names of the WPILib contributors to endorse or promote products derived from this software The following pieces of software have additional or alternate and or Google Inc All rights reserved Redistribution and use in source and binary with or without are permitted provided that the following conditions are this list of conditions and the following disclaimer *Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution *Neither the name of Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation and configuration files Object form shall mean any form resulting from mechanical transformation or translation of a Source including but not limited to compiled object generated and conversions to other media types Work shall mean the work of whether in Source or Object made available under the as indicated by a copyright notice that is included in or attached to the whether in Source or Object that is based or other modifications as a an original work of authorship For the purposes of this Derivative Works shall not include works that remain separable or merely the Work and Derivative Works thereof Contribution shall mean any work of including the original version of the Work and any modifications or additions to that Work or Derivative Works that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner For the purposes of this submitted means any form of or written communication sent to the Licensor or its including but not limited to communication on electronic mailing source code control and issue tracking systems that are managed or on behalf the Licensor for the purpose of discussing and improving the but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as Not a Contribution Contributor shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work Grant of Copyright License Subject to the terms and conditions of this each Contributor hereby grants to You a non no royalty free
Definition: ThirdPartyNotices.txt:151
you may not use this file except in compliance with the License You may obtain a copy of the License at software distributed under the License is distributed on an AS IS WITHOUT WARRANTIES OR CONDITIONS OF ANY either express or implied See the License for the specific language governing permissions and limitations under the License LLVM Exceptions to the Apache License As an exception
Definition: ThirdPartyNotices.txt:289
and restrictions which apply to each piece of software is included later in this file and or inside of the individual applicable source files The disclaimer of warranty in the WPILib license above applies to all code in and nothing in any of the other licenses gives permission to use the names of FIRST nor the names of the WPILib contributors to endorse or promote products derived from this software The following pieces of software have additional or alternate and or Google Inc All rights reserved Redistribution and use in source and binary with or without are permitted provided that the following conditions are this list of conditions and the following disclaimer *Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution *Neither the name of Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation and configuration files Object form shall mean any form resulting from mechanical transformation or translation of a Source including but not limited to compiled object generated and conversions to other media types Work shall mean the work of whether in Source or Object made available under the as indicated by a copyright notice that is included in or attached to the whether in Source or Object that is based or other modifications as a an original work of authorship For the purposes of this Derivative Works shall not include works that remain separable from
Definition: ThirdPartyNotices.txt:128
\rst Parsing context consisting of a format string range being parsed and an argument counter for aut...
Definition: core.h:656
\rst A dynamically growing memory buffer for trivially copyable/constructible types with the first SI...
Definition: format.h:918
An implementation of std::basic_string_view for pre-C++17.
Definition: core.h:398
constexpr auto size() const noexcept -> size_t
Returns the string size.
Definition: core.h:443
FMT_CONSTEXPR void remove_prefix(size_t n) noexcept
Definition: core.h:452
FMT_CONSTEXPR_CHAR_TRAITS bool starts_with(basic_string_view< Char > sv) const noexcept
Definition: core.h:457
FMT_CONSTEXPR auto data() noexcept -> T *
Returns a pointer to the buffer data (not null-terminated).
Definition: core.h:844
bool convert(basic_string_view< WChar > s, to_utf8_error_policy policy=to_utf8_error_policy::abort)
Definition: format.h:1447
typename std::enable_if< B, T >::type enable_if_t
Definition: core.h:256
#define FMT_ASSERT(condition, message)
Definition: core.h:336
basic_string_view< char > string_view
Definition: core.h:501
#define FMT_CONSTEXPR
Definition: core.h:105
#define FMT_BEGIN_NAMESPACE
Definition: core.h:174
#define FMT_END_NAMESPACE
Definition: core.h:177
bool_constant<!std::is_base_of< detail::unformattable, decltype(detail::arg_mapper< buffer_context< Char > >() .map(std::declval< T & >()))>::value > is_formattable
Definition: core.h:1764
#define FMT_EXPORT
Definition: core.h:183
detail namespace with internal helper functions
Definition: xchar.h:20
void void_t
Definition: core.h:1510
FMT_CONSTEXPR auto write_bytes(OutputIt out, string_view bytes, const format_specs< Char > &specs) -> OutputIt
Definition: format.h:1819
auto write(OutputIt out, const std::tm &time, const std::locale &loc, char format, char modifier=0) -> OutputIt
Definition: chrono.h:419
FMT_CONSTEXPR auto parse_dynamic_spec(const Char *begin, const Char *end, int &value, arg_ref< Char > &ref, basic_format_parse_context< Char > &ctx) -> const Char *
Definition: core.h:2237
FMT_INLINE auto to_string_view(const Char *s) -> basic_string_view< Char >
Definition: core.h:517
@ value
the parser finished reading a JSON value
auto write_escaped_char(OutputIt out, Char v) -> OutputIt
Definition: format.h:1986
type
Definition: core.h:556
FMT_CONSTEXPR auto to_unsigned(Int value) -> typename std::make_unsigned< Int >::type
Definition: core.h:374
FMT_CONSTEXPR auto maybe_set_debug_format(Formatter &f, bool set) -> decltype(f.set_debug_format(set))
Definition: ranges.h:292
FMT_CONSTEXPR auto parse_align(const Char *begin, const Char *end, format_specs< Char > &specs) -> const Char *
Definition: format.h:2399
#define FMT_USE_TYPEID
Definition: std.h:58
auto format(wformat_string< T... > fmt, T &&... args) -> std::wstring
Definition: xchar.h:108