X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstrings%2Ffmt.h;h=88b297d7bede12e4895398696e7b909f36bbd3ab;hb=refs%2Fheads%2Fwip;hp=ee84911bcec06fcd0fc34402ef8975133235b3ce;hpb=71be32fe7248a7d2df7dea4e18c5ebd30fd73d4b;p=libs%2Fcore.git diff --git a/source/strings/fmt.h b/source/strings/fmt.h index ee84911..88b297d 100644 --- a/source/strings/fmt.h +++ b/source/strings/fmt.h @@ -4,14 +4,14 @@ #include #include #include +#include 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 *);