From 09f98854bfe69f35193b98d4031fd056d15f4f62 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 1 Jan 2014 09:22:55 -0800 Subject: [PATCH] StrFormatter -> StrFormatSpec. --- format.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/format.h b/format.h index 6cff0554..84155d39 100644 --- a/format.h +++ b/format.h @@ -402,13 +402,14 @@ class IntFormatSpec : public SpecT { T value() const { return value_; } }; +// A string format specifier. template -class StrFormatter : public AlignSpec { +class StrFormatSpec : public AlignSpec { private: const T *str_; public: - StrFormatter(const T *str, const AlignSpec &spec = AlignSpec()) + StrFormatSpec(const T *str, const AlignSpec &spec = AlignSpec()) : AlignSpec(spec), str_(str) {} const T *str() const { return str_; } @@ -503,9 +504,9 @@ DEFINE_INT_FORMATTERS(unsigned long long) \endrst */ -inline StrFormatter pad( +inline StrFormatSpec pad( const char *str, unsigned width, wchar_t fill = ' ') { - return StrFormatter(str, AlignSpec(width, fill)); + return StrFormatSpec(str, AlignSpec(width, fill)); } template @@ -712,9 +713,9 @@ class BasicWriter { BasicWriter &operator<<(const IntFormatSpec &spec); template - BasicWriter &operator<<(const StrFormatter &f) { - const char *s = f.str(); - FormatString(s, std::strlen(s), f); + BasicWriter &operator<<(const StrFormatSpec &spec) { + const char *s = spec.str(); + FormatString(s, std::strlen(s), spec); return *this; }