|
18 | 18 | #endif
|
19 | 19 | #include <llvm/Support/raw_ostream.h>
|
20 | 20 |
|
21 |
| -#if __has_include(<format>) |
22 |
| - #define MRDOX_HAS_CXX20_FORMAT |
23 |
| -#endif |
24 |
| - |
25 |
| -#ifdef MRDOX_HAS_CXX20_FORMAT |
26 |
| - #include <format> |
27 |
| - #include <string> |
28 |
| - #include <mrdox/MetadataFwd.hpp> |
29 |
| - |
30 |
| - template<> |
31 |
| - struct std::formatter<clang::mrdox::SymbolID> |
32 |
| - : std::formatter<std::string> |
33 |
| - { |
34 |
| - std::format_context::iterator format( |
35 |
| - const clang::mrdox::SymbolID& s, |
36 |
| - std::format_context& ctx) const; |
37 |
| - }; |
38 |
| - |
39 |
| - template<> |
40 |
| - struct std::formatter<clang::mrdox::OptionalSymbolID> |
41 |
| - : std::formatter<clang::mrdox::SymbolID> |
42 |
| - { |
43 |
| - std::format_context::iterator format( |
44 |
| - const clang::mrdox::OptionalSymbolID& s, |
45 |
| - std::format_context& ctx) const; |
46 |
| - }; |
47 |
| - |
48 |
| - template<> |
49 |
| - struct std::formatter<clang::mrdox::InfoType> |
50 |
| - : std::formatter<std::string> |
51 |
| - { |
52 |
| - std::format_context::iterator format( |
53 |
| - clang::mrdox::InfoType t, |
54 |
| - std::format_context& ctx) const; |
55 |
| - }; |
56 |
| - |
57 |
| - template<> |
58 |
| - struct std::formatter<clang::mrdox::Access> |
59 |
| - : std::formatter<std::string> |
60 |
| - { |
61 |
| - std::format_context::iterator format( |
62 |
| - clang::mrdox::Access a, |
63 |
| - std::format_context& ctx) const; |
64 |
| - }; |
65 |
| - |
66 |
| - template<> |
67 |
| - struct std::formatter<clang::mrdox::Reference> |
68 |
| - : std::formatter<std::string> |
69 |
| - { |
70 |
| - std::format_context::iterator format( |
71 |
| - const clang::mrdox::Reference& r, |
72 |
| - std::format_context& ctx) const; |
73 |
| - }; |
74 |
| - |
75 |
| - template<> |
76 |
| - struct std::formatter<clang::mrdox::MemberRef> |
77 |
| - : std::formatter<std::string> |
78 |
| - { |
79 |
| - std::format_context::iterator format( |
80 |
| - const clang::mrdox::MemberRef& r, |
81 |
| - std::format_context& ctx) const; |
82 |
| - }; |
83 |
| - |
84 |
| - template<> |
85 |
| - struct std::formatter<clang::mrdox::Info> |
86 |
| - : std::formatter<std::string> |
87 |
| - { |
88 |
| - std::format_context::iterator format( |
89 |
| - const clang::mrdox::Info& i, |
90 |
| - std::format_context& ctx) const; |
91 |
| - }; |
92 |
| -#endif |
| 21 | +#include <fmt/format.h> |
| 22 | +#include <string> |
| 23 | +#include <mrdox/MetadataFwd.hpp> |
| 24 | + |
| 25 | +template<> |
| 26 | +struct fmt::formatter<clang::mrdox::SymbolID> |
| 27 | + : fmt::formatter<std::string> |
| 28 | +{ |
| 29 | + fmt::format_context::iterator format( |
| 30 | + const clang::mrdox::SymbolID& s, |
| 31 | + fmt::format_context& ctx) const; |
| 32 | +}; |
| 33 | + |
| 34 | +template<> |
| 35 | +struct fmt::formatter<clang::mrdox::OptionalSymbolID> |
| 36 | + : fmt::formatter<clang::mrdox::SymbolID> |
| 37 | +{ |
| 38 | + fmt::format_context::iterator format( |
| 39 | + const clang::mrdox::OptionalSymbolID& s, |
| 40 | + fmt::format_context& ctx) const; |
| 41 | +}; |
| 42 | + |
| 43 | +template<> |
| 44 | +struct fmt::formatter<clang::mrdox::InfoType> |
| 45 | + : fmt::formatter<std::string> |
| 46 | +{ |
| 47 | + fmt::format_context::iterator format( |
| 48 | + clang::mrdox::InfoType t, |
| 49 | + fmt::format_context& ctx) const; |
| 50 | +}; |
| 51 | + |
| 52 | +template<> |
| 53 | +struct fmt::formatter<clang::mrdox::Access> |
| 54 | + : fmt::formatter<std::string> |
| 55 | +{ |
| 56 | + fmt::format_context::iterator format( |
| 57 | + clang::mrdox::Access a, |
| 58 | + fmt::format_context& ctx) const; |
| 59 | +}; |
| 60 | + |
| 61 | +template<> |
| 62 | +struct fmt::formatter<clang::mrdox::Reference> |
| 63 | + : fmt::formatter<std::string> |
| 64 | +{ |
| 65 | + fmt::format_context::iterator format( |
| 66 | + const clang::mrdox::Reference& r, |
| 67 | + fmt::format_context& ctx) const; |
| 68 | +}; |
| 69 | + |
| 70 | +template<> |
| 71 | +struct fmt::formatter<clang::mrdox::MemberRef> |
| 72 | + : fmt::formatter<std::string> |
| 73 | +{ |
| 74 | + fmt::format_context::iterator format( |
| 75 | + const clang::mrdox::MemberRef& r, |
| 76 | + fmt::format_context& ctx) const; |
| 77 | +}; |
| 78 | + |
| 79 | +template<> |
| 80 | +struct fmt::formatter<clang::mrdox::Info> |
| 81 | + : fmt::formatter<std::string> |
| 82 | +{ |
| 83 | + fmt::format_context::iterator format( |
| 84 | + const clang::mrdox::Info& i, |
| 85 | + fmt::format_context& ctx) const; |
| 86 | +}; |
93 | 87 |
|
94 | 88 | // Some nice odds and ends such as leak checking
|
95 | 89 | // and redirection to the Visual Studio output window.
|
|
0 commit comments