ArgList -> format_args
diff --git a/fmt/format.cc b/fmt/format.cc
index 7fd0308..8b175bb 100644
--- a/fmt/format.cc
+++ b/fmt/format.cc
@@ -223,7 +223,7 @@
} // namespace internal
FMT_FUNC void SystemError::init(
- int err_code, CStringRef format_str, ArgList args) {
+ int err_code, CStringRef format_str, format_args args) {
error_code_ = err_code;
MemoryWriter w;
format_system_error(w, err_code, format(format_str, args));
@@ -347,7 +347,7 @@
}
FMT_FUNC void WindowsError::init(
- int err_code, CStringRef format_str, ArgList args) {
+ int err_code, CStringRef format_str, format_args args) {
error_code_ = err_code;
MemoryWriter w;
internal::format_windows_error(w, err_code, format(format_str, args));
@@ -404,13 +404,13 @@
}
template <typename Char>
-void internal::ArgMap<Char>::init(const ArgList &args) {
+void internal::ArgMap<Char>::init(const format_args &args) {
if (!map_.empty())
return;
typedef internal::NamedArg<Char> NamedArg;
const NamedArg *named_arg = 0;
bool use_values =
- args.type(ArgList::MAX_PACKED_ARGS - 1) == internal::Arg::NONE;
+ args.type(format_args::MAX_PACKED_ARGS - 1) == internal::Arg::NONE;
if (use_values) {
for (unsigned i = 0;/*nothing*/; ++i) {
internal::Arg::Type arg_type = args.type(i);
@@ -427,14 +427,14 @@
}
return;
}
- for (unsigned i = 0; i != ArgList::MAX_PACKED_ARGS; ++i) {
+ for (unsigned i = 0; i != format_args::MAX_PACKED_ARGS; ++i) {
internal::Arg::Type arg_type = args.type(i);
if (arg_type == internal::Arg::NAMED_ARG) {
named_arg = static_cast<const NamedArg*>(args.args_[i].pointer);
map_.push_back(Pair(named_arg->name, *named_arg));
}
}
- for (unsigned i = ArgList::MAX_PACKED_ARGS;/*nothing*/; ++i) {
+ for (unsigned i = format_args::MAX_PACKED_ARGS;/*nothing*/; ++i) {
switch (args.args_[i].type) {
case internal::Arg::NONE:
return;
@@ -483,17 +483,17 @@
}
#endif
-FMT_FUNC void print(std::FILE *f, CStringRef format_str, ArgList args) {
+FMT_FUNC void print(std::FILE *f, CStringRef format_str, format_args args) {
MemoryWriter w;
w.write(format_str, args);
std::fwrite(w.data(), 1, w.size(), f);
}
-FMT_FUNC void print(CStringRef format_str, ArgList args) {
+FMT_FUNC void print(CStringRef format_str, format_args args) {
print(stdout, format_str, args);
}
-FMT_FUNC void print_colored(Color c, CStringRef format, ArgList args) {
+FMT_FUNC void print_colored(Color c, CStringRef format, format_args args) {
char escape[] = "\x1b[30m";
escape[3] = static_cast<char>('0' + c);
std::fputs(escape, stdout);
@@ -502,9 +502,9 @@
}
template <typename Char>
-void printf(BasicWriter<Char> &w, BasicCStringRef<Char> format, ArgList args);
+void printf(BasicWriter<Char> &w, BasicCStringRef<Char> format, format_args args);
-FMT_FUNC int fprintf(std::FILE *f, CStringRef format, ArgList args) {
+FMT_FUNC int fprintf(std::FILE *f, CStringRef format, format_args args) {
MemoryWriter w;
printf(w, format, args);
std::size_t size = w.size();
@@ -519,7 +519,7 @@
template void internal::FixedBuffer<char>::grow(std::size_t);
-template void internal::ArgMap<char>::init(const ArgList &args);
+template void internal::ArgMap<char>::init(const format_args &args);
template void PrintfFormatter<char>::format(CStringRef format);
@@ -535,7 +535,7 @@
template void internal::FixedBuffer<wchar_t>::grow(std::size_t);
-template void internal::ArgMap<wchar_t>::init(const ArgList &args);
+template void internal::ArgMap<wchar_t>::init(const format_args &args);
template void PrintfFormatter<wchar_t>::format(WCStringRef format);
diff --git a/fmt/format.h b/fmt/format.h
index 6f96e84..7ca1de9 100644
--- a/fmt/format.h
+++ b/fmt/format.h
@@ -1351,8 +1351,8 @@
class ArgMap;
} // namespace internal
-/** An argument list. */
-class ArgList {
+/** Formatting arguments. */
+class format_args {
private:
// To reduce compiled code size per formatting function call, types of first
// MAX_PACKED_ARGS arguments are passed in the types_ field.
@@ -1381,11 +1381,11 @@
// Maximum number of arguments with packed types.
enum { MAX_PACKED_ARGS = 16 };
- ArgList() : types_(0) {}
+ format_args() : types_(0) {}
- ArgList(ULongLong types, const internal::Value *values)
+ format_args(ULongLong types, const internal::Value *values)
: types_(types), values_(values) {}
- ArgList(ULongLong types, const internal::Arg *args)
+ format_args(ULongLong types, const internal::Arg *args)
: types_(types), args_(args) {}
/** Returns the argument at specified index. */
@@ -1809,7 +1809,7 @@
MapType map_;
public:
- FMT_API void init(const ArgList &args);
+ FMT_API void init(const format_args &args);
const internal::Arg* find(const fmt::BasicStringRef<Char> &name) const {
// The list is unsorted, so just return the first matching name.
@@ -1922,16 +1922,16 @@
class FormatterBase {
private:
- ArgList args_;
+ format_args args_;
int next_arg_index_;
// Returns the argument with specified index.
FMT_API Arg do_get_arg(unsigned arg_index, const char *&error);
protected:
- const ArgList &args() const { return args_; }
+ const format_args &args() const { return args_; }
- explicit FormatterBase(const ArgList &args) {
+ explicit FormatterBase(const format_args &args) {
args_ = args;
next_arg_index_ = 0;
}
@@ -2053,7 +2053,7 @@
appropriate lifetimes.
\endrst
*/
- BasicFormatter(const ArgList &args, BasicWriter<Char> &w)
+ BasicFormatter(const format_args &args, BasicWriter<Char> &w)
: internal::FormatterBase(args), writer_(w) {}
/** Returns a reference to the writer associated with this formatter. */
@@ -2093,7 +2093,7 @@
return MakeValue< BasicFormatter<char> >::type(arg);
}
-template <unsigned N, bool/*IsPacked*/= (N < ArgList::MAX_PACKED_ARGS)>
+template <unsigned N, bool/*IsPacked*/= (N < format_args::MAX_PACKED_ARGS)>
struct ArgArray;
template <unsigned N>
@@ -2143,7 +2143,7 @@
typedef fmt::internal::ArgArray<sizeof...(Args)> ArgArray; \
typename ArgArray::Type array{ \
ArgArray::template make<fmt::BasicFormatter<Char> >(args)...}; \
- func(arg0, fmt::ArgList(fmt::internal::make_type(args...), array)); \
+ func(arg0, fmt::format_args(fmt::internal::make_type(args...), array)); \
}
// Defines a variadic constructor.
@@ -2153,7 +2153,7 @@
typedef fmt::internal::ArgArray<sizeof...(Args)> ArgArray; \
typename ArgArray::Type array{ \
ArgArray::template make<fmt::BasicFormatter<Char> >(args)...}; \
- func(arg0, arg1, fmt::ArgList(fmt::internal::make_type(args...), array)); \
+ func(arg0, arg1, fmt::format_args(fmt::internal::make_type(args...), array)); \
}
// Generates a comma-separated list with results of applying f to pairs
@@ -2184,7 +2184,7 @@
*/
class SystemError : public internal::RuntimeError {
private:
- void init(int err_code, CStringRef format_str, ArgList args);
+ void init(int err_code, CStringRef format_str, format_args args);
protected:
int error_code_;
@@ -2213,7 +2213,7 @@
\endrst
*/
SystemError(int error_code, CStringRef message) {
- init(error_code, message, ArgList());
+ init(error_code, message, format_args());
}
FMT_VARIADIC_CTOR(SystemError, init, int, CStringRef)
@@ -2433,7 +2433,7 @@
See also :ref:`syntax`.
\endrst
*/
- void write(BasicCStringRef<Char> format, ArgList args) {
+ void write(BasicCStringRef<Char> format, format_args args) {
BasicFormatter<Char>(args, *this).format(format);
}
FMT_VARIADIC_VOID(write, BasicCStringRef<Char>)
@@ -3030,7 +3030,7 @@
/** A Windows error. */
class WindowsError : public SystemError {
private:
- FMT_API void init(int error_code, CStringRef format_str, ArgList args);
+ FMT_API void init(int error_code, CStringRef format_str, format_args args);
public:
/**
@@ -3062,7 +3062,7 @@
\endrst
*/
WindowsError(int error_code, CStringRef message) {
- init(error_code, message, ArgList());
+ init(error_code, message, format_args());
}
FMT_VARIADIC_CTOR(WindowsError, init, int, CStringRef)
};
@@ -3082,7 +3082,7 @@
Example:
print_colored(fmt::RED, "Elapsed time: {0:.2f} seconds", 1.23);
*/
-FMT_API void print_colored(Color c, CStringRef format, ArgList args);
+FMT_API void print_colored(Color c, CStringRef format, format_args args);
/**
\rst
@@ -3093,13 +3093,13 @@
std::string message = format("The answer is {}", 42);
\endrst
*/
-inline std::string format(CStringRef format_str, ArgList args) {
+inline std::string format(CStringRef format_str, format_args args) {
MemoryWriter w;
w.write(format_str, args);
return w.str();
}
-inline std::wstring format(WCStringRef format_str, ArgList args) {
+inline std::wstring format(WCStringRef format_str, format_args args) {
WMemoryWriter w;
w.write(format_str, args);
return w.str();
@@ -3114,7 +3114,7 @@
print(stderr, "Don't {}!", "panic");
\endrst
*/
-FMT_API void print(std::FILE *f, CStringRef format_str, ArgList args);
+FMT_API void print(std::FILE *f, CStringRef format_str, format_args args);
/**
\rst
@@ -3125,7 +3125,7 @@
print("Elapsed time: {0:.2f} seconds", 1.23);
\endrst
*/
-FMT_API void print(CStringRef format_str, ArgList args);
+FMT_API void print(CStringRef format_str, format_args args);
/**
Fast integer formatter.
@@ -3294,7 +3294,7 @@
typename ArgArray::Type array{ \
ArgArray::template make<fmt::BasicFormatter<Char> >(args)...}; \
call(FMT_FOR_EACH(FMT_GET_ARG_NAME, __VA_ARGS__), \
- fmt::ArgList(fmt::internal::make_type(args...), array)); \
+ fmt::format_args(fmt::internal::make_type(args...), array)); \
}
/**
@@ -3305,7 +3305,7 @@
**Example**::
void print_error(const char *file, int line, const char *format,
- fmt::ArgList args) {
+ fmt::format_args args) {
fmt::print("{}: {}: ", file, line);
fmt::print(format, args);
}
diff --git a/fmt/ostream.cc b/fmt/ostream.cc
index 2890b4a..92b00a0 100644
--- a/fmt/ostream.cc
+++ b/fmt/ostream.cc
@@ -27,7 +27,7 @@
}
}
-FMT_FUNC void print(std::ostream &os, CStringRef format_str, ArgList args) {
+FMT_FUNC void print(std::ostream &os, CStringRef format_str, format_args args) {
MemoryWriter w;
w.write(format_str, args);
internal::write(os, w);
diff --git a/fmt/ostream.h b/fmt/ostream.h
index e21b2f6..db433ea 100644
--- a/fmt/ostream.h
+++ b/fmt/ostream.h
@@ -95,7 +95,7 @@
print(cerr, "Don't {}!", "panic");
\endrst
*/
-FMT_API void print(std::ostream &os, CStringRef format_str, ArgList args);
+FMT_API void print(std::ostream &os, CStringRef format_str, format_args args);
FMT_VARIADIC(void, print, std::ostream &, CStringRef)
} // namespace fmt
diff --git a/fmt/posix.h b/fmt/posix.h
index 7c2b0b5..e6b2e90 100644
--- a/fmt/posix.h
+++ b/fmt/posix.h
@@ -166,7 +166,7 @@
// of MinGW that define fileno as a macro.
int (fileno)() const;
- void print(CStringRef format_str, const ArgList &args) {
+ void print(CStringRef format_str, const format_args &args) {
fmt::print(file_, format_str, args);
}
FMT_VARIADIC(void, print, CStringRef)
diff --git a/fmt/printf.h b/fmt/printf.h
index e83a997..9be2c42 100644
--- a/fmt/printf.h
+++ b/fmt/printf.h
@@ -262,7 +262,7 @@
/** Formats an argument of a custom (user-defined) type. */
void visit_custom(internal::Arg::CustomValue c) {
- BasicFormatter<Char> formatter(ArgList(), this->writer());
+ BasicFormatter<Char> formatter(format_args(), this->writer());
const Char format_str[] = {'}', 0};
const Char *format = format_str;
c.format(&formatter, c.value, &format);
@@ -304,7 +304,7 @@
appropriate lifetimes.
\endrst
*/
- explicit PrintfFormatter(const ArgList &args, BasicWriter<Char> &w)
+ explicit PrintfFormatter(const format_args &args, BasicWriter<Char> &w)
: FormatterBase(args), writer_(w) {}
/** Formats stored arguments and writes the output to the writer. */
@@ -484,7 +484,7 @@
}
template <typename Char>
-void printf(BasicWriter<Char> &w, BasicCStringRef<Char> format, ArgList args) {
+void printf(BasicWriter<Char> &w, BasicCStringRef<Char> format, format_args args) {
PrintfFormatter<Char>(args, w).format(format);
}
@@ -497,14 +497,14 @@
std::string message = fmt::sprintf("The answer is %d", 42);
\endrst
*/
-inline std::string sprintf(CStringRef format, ArgList args) {
+inline std::string sprintf(CStringRef format, format_args args) {
MemoryWriter w;
printf(w, format, args);
return w.str();
}
FMT_VARIADIC(std::string, sprintf, CStringRef)
-inline std::wstring sprintf(WCStringRef format, ArgList args) {
+inline std::wstring sprintf(WCStringRef format, format_args args) {
WMemoryWriter w;
printf(w, format, args);
return w.str();
@@ -520,7 +520,7 @@
fmt::fprintf(stderr, "Don't %s!", "panic");
\endrst
*/
-FMT_API int fprintf(std::FILE *f, CStringRef format, ArgList args);
+FMT_API int fprintf(std::FILE *f, CStringRef format, format_args args);
FMT_VARIADIC(int, fprintf, std::FILE *, CStringRef)
/**
@@ -532,7 +532,7 @@
fmt::printf("Elapsed time: %.2f seconds", 1.23);
\endrst
*/
-inline int printf(CStringRef format, ArgList args) {
+inline int printf(CStringRef format, format_args args) {
return fprintf(stdout, format, args);
}
FMT_VARIADIC(int, printf, CStringRef)
@@ -546,7 +546,7 @@
fprintf(cerr, "Don't %s!", "panic");
\endrst
*/
-inline int fprintf(std::ostream &os, CStringRef format_str, ArgList args) {
+inline int fprintf(std::ostream &os, CStringRef format_str, format_args args) {
MemoryWriter w;
printf(w, format_str, args);
internal::write(os, w);
diff --git a/test/custom-formatter-test.cc b/test/custom-formatter-test.cc
index cc9c448..436986c 100644
--- a/test/custom-formatter-test.cc
+++ b/test/custom-formatter-test.cc
@@ -45,7 +45,7 @@
}
};
-std::string custom_format(const char *format_str, fmt::ArgList args) {
+std::string custom_format(const char *format_str, fmt::format_args args) {
fmt::MemoryWriter writer;
// Pass custom argument formatter as a template arg to BasicFormatter.
fmt::BasicFormatter<char, CustomArgFormatter> formatter(args, writer);
@@ -54,7 +54,7 @@
}
FMT_VARIADIC(std::string, custom_format, const char *)
-std::string custom_sprintf(const char* format_str, fmt::ArgList args){
+std::string custom_sprintf(const char* format_str, fmt::format_args args){
fmt::MemoryWriter writer;
fmt::PrintfFormatter<char, CustomPrintfArgFormatter> formatter(args, writer);
formatter.format(format_str);
diff --git a/test/format-test.cc b/test/format-test.cc
index a92d875..e18d136 100644
--- a/test/format-test.cc
+++ b/test/format-test.cc
@@ -1564,7 +1564,7 @@
}
std::string format_message(int id, const char *format,
- const fmt::ArgList &args) {
+ const fmt::format_args &args) {
MemoryWriter w;
w.write("[{}] ", id);
w.write(format, args);
@@ -1643,7 +1643,7 @@
MOCK_METHOD1(visit_int, void (int value));
};
-void custom_format(const char *format_str, fmt::ArgList args) {
+void custom_format(const char *format_str, fmt::format_args args) {
fmt::MemoryWriter writer;
fmt::BasicFormatter<char, MockArgFormatter> formatter(args, writer);
formatter.format(format_str);
diff --git a/test/macro-test.cc b/test/macro-test.cc
index ea2fbfd..ed35151 100644
--- a/test/macro-test.cc
+++ b/test/macro-test.cc
@@ -67,7 +67,7 @@
int result;
#define MAKE_TEST(func) \
- void func(const char *, const fmt::ArgList &args) { \
+ void func(const char *, const fmt::format_args &args) { \
result = 0; \
for (unsigned i = 0; args[i].type; ++i) \
result += args[i].int_value; \
@@ -91,7 +91,7 @@
#define GET_TYPE(n) S<n>
-int test_variadic(FMT_GEN(10, GET_TYPE), const fmt::ArgList &args) { \
+int test_variadic(FMT_GEN(10, GET_TYPE), const fmt::format_args &args) { \
int result = 0; \
for (unsigned i = 0; args[i].type; ++i) \
result += args[i].int_value; \
diff --git a/test/ostream-test.cc b/test/ostream-test.cc
index fa2c40d..9542a28 100644
--- a/test/ostream-test.cc
+++ b/test/ostream-test.cc
@@ -67,7 +67,7 @@
TEST(OStreamTest, CustomArg) {
fmt::MemoryWriter writer;
typedef fmt::BasicFormatter<char, TestArgFormatter> Formatter;
- Formatter formatter(fmt::ArgList(), writer);
+ Formatter formatter(fmt::format_args(), writer);
fmt::FormatSpec spec;
TestArgFormatter af(formatter, spec, "}");
af.visit(fmt::internal::MakeArg<Formatter>(TestEnum()));
diff --git a/test/util-test.cc b/test/util-test.cc
index d67dd52..376ea12 100644
--- a/test/util-test.cc
+++ b/test/util-test.cc
@@ -566,14 +566,14 @@
EXPECT_EQ(fmt::internal::Arg::CUSTOM, arg.type);
EXPECT_EQ(&t, arg.custom.value);
fmt::MemoryWriter w;
- fmt::BasicFormatter<char> formatter(fmt::ArgList(), w);
+ fmt::BasicFormatter<char> formatter(fmt::format_args(), w);
const char *s = "}";
arg.custom.format(&formatter, &t, &s);
EXPECT_EQ("test", w.str());
}
-TEST(UtilTest, ArgList) {
- fmt::ArgList args;
+TEST(UtilTest, FormatArgs) {
+ fmt::format_args args;
EXPECT_EQ(Arg::NONE, args[1].type);
}