]> git.tdb.fi Git - libs/core.git/blobdiff - source/strings/format.cpp
Remove deprecated things
[libs/core.git] / source / strings / format.cpp
index 4b5bcd0c43e2cf734a54dfd65c18f95b405c19cc..773eefac7fc30698bab7c8d6ebfca8fb1188de18 100644 (file)
@@ -11,10 +11,20 @@ Formatter::Formatter(const string &f):
        advance();
 }
 
-/**
-Returns the result of the formatting operation.  Will throw if not enough
-values have been fed to the formatter.
-*/
+Formatter::Formatter(const Formatter &other):
+       fmt(other.fmt),
+       pos(fmt.begin()+(other.pos-other.fmt.begin())),
+       result(other.result)
+{ }
+
+Formatter &Formatter::operator=(const Formatter &other)
+{
+       fmt = other.fmt;
+       pos = fmt.begin()+(other.pos-other.fmt.begin());
+       result = other.result;
+       return *this;
+}
+
 const string &Formatter::str() const
 {
        if(pos!=fmt.end())
@@ -23,11 +33,6 @@ const string &Formatter::str() const
        return result;
 }
 
-/**
-Advances the pos iterator to the next conversion, adding literal characters to
-the result.  The iterator is left at the second character of the conversion
-(i.e. after the %).
-*/
 void Formatter::advance()
 {
        for(; pos!=fmt.end(); ++pos)
@@ -45,10 +50,6 @@ void Formatter::advance()
        }
 }
 
-/**
-Reads the next conversion from the format string and returns a corresponding
-Fmt object.
-*/
 Fmt Formatter::get_conversion()
 {
        if(pos==fmt.end())