mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-02 02:29:08 +00:00
format_arg -> format_value
This commit is contained in:
parent
13b04044e5
commit
65a8c2c343
@ -1154,7 +1154,7 @@ inline fmt::StringRef thousands_sep(...) { return ""; }
|
||||
#endif
|
||||
|
||||
template <typename Formatter, typename Char, typename T>
|
||||
void format_arg(Formatter &, const Char *, const T &) {
|
||||
void format_value(Formatter &, const Char *, const T &) {
|
||||
FMT_STATIC_ASSERT(False<T>::value,
|
||||
"Cannot format argument. To enable the use of ostream "
|
||||
"operator<< include fmt/ostream.h. Otherwise provide "
|
||||
@ -1266,9 +1266,9 @@ class MakeValue : public Arg {
|
||||
template <typename T>
|
||||
static void format_custom_arg(
|
||||
void *formatter, const void *arg, void *format_str_ptr) {
|
||||
format_arg(*static_cast<Formatter*>(formatter),
|
||||
*static_cast<const Char**>(format_str_ptr),
|
||||
*static_cast<const T*>(arg));
|
||||
format_value(*static_cast<Formatter*>(formatter),
|
||||
*static_cast<const Char**>(format_str_ptr),
|
||||
*static_cast<const T*>(arg));
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -73,7 +73,7 @@ void write(std::ostream &os, Writer &w);
|
||||
|
||||
// Formats a value.
|
||||
template <typename Char, typename ArgFormatter, typename T>
|
||||
void format_arg(BasicFormatter<Char, ArgFormatter> &f,
|
||||
void format_value(BasicFormatter<Char, ArgFormatter> &f,
|
||||
const Char *&format_str, const T &value) {
|
||||
internal::MemoryBuffer<Char, internal::INLINE_BUFFER_SIZE> buffer;
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
namespace fmt {
|
||||
template <typename ArgFormatter>
|
||||
void format_arg(BasicFormatter<char, ArgFormatter> &f,
|
||||
void format_value(BasicFormatter<char, ArgFormatter> &f,
|
||||
const char *&format_str, const std::tm &tm) {
|
||||
if (*format_str == ':')
|
||||
++format_str;
|
||||
|
@ -1355,7 +1355,7 @@ TEST(FormatterTest, FormatCStringRef) {
|
||||
EXPECT_EQ("test", format("{0}", CStringRef("test")));
|
||||
}
|
||||
|
||||
void format_arg(fmt::BasicFormatter<char> &f, const char *, const Date &d) {
|
||||
void format_value(fmt::BasicFormatter<char> &f, const char *, const Date &d) {
|
||||
f.writer() << d.year() << '-' << d.month() << '-' << d.day();
|
||||
}
|
||||
|
||||
@ -1368,7 +1368,7 @@ TEST(FormatterTest, FormatCustom) {
|
||||
class Answer {};
|
||||
|
||||
template <typename Char>
|
||||
void format_arg(fmt::BasicFormatter<Char> &f, const Char *, Answer) {
|
||||
void format_value(fmt::BasicFormatter<Char> &f, const Char *, Answer) {
|
||||
f.writer() << "42";
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ namespace {
|
||||
struct Test {};
|
||||
|
||||
template <typename Char>
|
||||
void format_arg(fmt::BasicFormatter<Char> &f, const Char *, Test) {
|
||||
void format_value(fmt::BasicFormatter<Char> &f, const Char *, Test) {
|
||||
f.writer() << "test";
|
||||
}
|
||||
|
||||
@ -581,7 +581,7 @@ struct CustomFormatter {
|
||||
typedef char Char;
|
||||
};
|
||||
|
||||
void format_arg(CustomFormatter &, const char *&s, const Test &) {
|
||||
void format_value(CustomFormatter &, const char *&s, const Test &) {
|
||||
s = "custom_format";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user