format_arg -> format_value

This commit is contained in:
Victor Zverovich 2016-10-02 08:49:10 -07:00
parent 13b04044e5
commit 65a8c2c343
5 changed files with 10 additions and 10 deletions

View File

@ -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:

View File

@ -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;

View File

@ -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;

View File

@ -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";
}

View File

@ -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";
}