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