]> git.tdb.fi Git - libs/core.git/blobdiff - source/formatter.h
Further style and comment adjustments
[libs/core.git] / source / formatter.h
index 521dd559237bcc76943d0858a18315abed69ce85..cde508bac9740aaf9c0064166436b38354a3d7f4 100644 (file)
@@ -18,29 +18,28 @@ Printf-like string formatter class.
 */
 class Formatter
 {
+private:
+       std::string fmt;
+       std::string::iterator pos;
+       std::string result;
+
 public:
        Formatter(const std::string &);
 
-       /**
-       Extracts the next conversion from the format string and formats the given
-       value with it.  Will throw if no more conversions are found.
-       */
+       /** Extracts the next conversion from the format string and formats the
+       given value with it.  Will throw if no more conversions are found. */
        template<typename T>
        Formatter &operator()(const T &a)
        {
-               result+=lexical_cast(a, get_conversion());
+               result += lexical_cast(a, get_conversion());
                advance();
                return *this;
        }
 
        const std::string &str() const;
 private:
-       std::string fmt;
-       std::string::iterator pos;
-       std::string result;
-
        void advance();
-       Fmt  get_conversion();
+       Fmt get_conversion();
 };
 
 inline Formatter format(const std::string &f)