]> git.tdb.fi Git - libs/core.git/blobdiff - source/strings/fmt.h
Add move semantics to Variant
[libs/core.git] / source / strings / fmt.h
index ee84911bcec06fcd0fc34402ef8975133235b3ce..88b297d7bede12e4895398696e7b909f36bbd3ab 100644 (file)
@@ -4,14 +4,14 @@
 #include <ostream>
 #include <stdexcept>
 #include <string>
+#include <msp/core/mspcore_api.h>
 
 namespace Msp {
 
-class format_error: public std::logic_error
+class MSPCORE_API format_error: public std::logic_error
 {
 public:
        format_error(const std::string &w): std::logic_error(w) { }
-       virtual ~format_error() throw() { }
 };
 
 
@@ -35,7 +35,7 @@ Some new conversions are supported:
   b/B  Binary integer conversion
   P    Uppercase pointer conversion (like %#X)
 */
-class Fmt
+class MSPCORE_API Fmt
 {
 public:
        enum Type
@@ -68,22 +68,22 @@ public:
        };
 
 private:
-       unsigned wd;
-       unsigned prec;
-       bool spos;
-       wchar_t fillc;
-       Base base;
-       bool sbase;
-       FloatMode fmode;
-       bool spoint;
-       Align align;
-       bool ucase;
-       Type type;
+       unsigned wd = 0;
+       unsigned prec = 6;
+       bool spos = false;
+       wchar_t fillc = ' ';
+       Base base = DEC;
+       bool sbase = false;
+       FloatMode fmode = AUTOFLT;
+       bool spoint = false;
+       Align align = RIGHT;
+       bool ucase = false;
+       Type type = STR;
 
 public:
-       Fmt() { reset(); }
-       Fmt(const char *f) { reset(); parse(f); }
-       Fmt(const std::string &f) { reset(); parse(f.c_str()); }
+       Fmt() = default;
+       Fmt(const char *f) { parse(f); }
+       Fmt(const std::string &f) { parse(f.c_str()); }
 
 private:
        void parse(const char *);