mirror of
https://github.com/AxioDL/logvisor.git
synced 2025-06-06 14:43:30 +00:00
Fix custom formatting of multiple character types
This commit is contained in:
parent
3bedd268e8
commit
dcd0ffcaec
2
fmt
2
fmt
@ -1 +1 @@
|
|||||||
Subproject commit 6bcc3fd21694b5634cc006915bd049cf460a9a8d
|
Subproject commit 25ff2efc0aeab3ce886fb6be11a1878f3497ec4c
|
@ -257,10 +257,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define Lfmt(str) fmt(L##str)
|
#define FMT_CUSTOM_FORMATTER(tp, fmtstr, ...) \
|
||||||
#define ufmt(str) fmt(u##str)
|
|
||||||
#define Ufmt(str) fmt(U##str)
|
|
||||||
#define FMT_CUSTOM_FORMATTER(tp, ...) \
|
|
||||||
namespace fmt { \
|
namespace fmt { \
|
||||||
template <> \
|
template <> \
|
||||||
struct formatter<tp, char> { \
|
struct formatter<tp, char> { \
|
||||||
@ -268,7 +265,7 @@ struct formatter<tp, char> { \
|
|||||||
constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } \
|
constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } \
|
||||||
template <typename FormatContext> \
|
template <typename FormatContext> \
|
||||||
auto format(const tp &obj, FormatContext &ctx) { \
|
auto format(const tp &obj, FormatContext &ctx) { \
|
||||||
return format_to(ctx.out(), __VA_ARGS__); \
|
return format_to(ctx.out(), fmt(fmtstr), __VA_ARGS__); \
|
||||||
} \
|
} \
|
||||||
}; \
|
}; \
|
||||||
template <> \
|
template <> \
|
||||||
@ -277,7 +274,7 @@ struct formatter<tp, wchar_t> { \
|
|||||||
constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } \
|
constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } \
|
||||||
template <typename FormatContext> \
|
template <typename FormatContext> \
|
||||||
auto format(const tp &obj, FormatContext &ctx) { \
|
auto format(const tp &obj, FormatContext &ctx) { \
|
||||||
return format_to(ctx.out(), L##__VA_ARGS__); \
|
return format_to(ctx.out(), fmt(L##fmtstr), __VA_ARGS__); \
|
||||||
} \
|
} \
|
||||||
}; \
|
}; \
|
||||||
template <> \
|
template <> \
|
||||||
@ -286,7 +283,7 @@ struct formatter<tp, char16_t> { \
|
|||||||
constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } \
|
constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } \
|
||||||
template <typename FormatContext> \
|
template <typename FormatContext> \
|
||||||
auto format(const tp &obj, FormatContext &ctx) { \
|
auto format(const tp &obj, FormatContext &ctx) { \
|
||||||
return format_to(ctx.out(), u##__VA_ARGS__); \
|
return format_to(ctx.out(), fmt(u##fmtstr), __VA_ARGS__); \
|
||||||
} \
|
} \
|
||||||
}; \
|
}; \
|
||||||
template <> \
|
template <> \
|
||||||
@ -295,7 +292,7 @@ struct formatter<tp, char32_t> { \
|
|||||||
constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } \
|
constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } \
|
||||||
template <typename FormatContext> \
|
template <typename FormatContext> \
|
||||||
auto format(const tp &obj, FormatContext &ctx) { \
|
auto format(const tp &obj, FormatContext &ctx) { \
|
||||||
return format_to(ctx.out(), U##__VA_ARGS__); \
|
return format_to(ctx.out(), fmt(U##fmtstr), __VA_ARGS__); \
|
||||||
} \
|
} \
|
||||||
}; \
|
}; \
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user