X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fstrings%2Ffmt.cpp;h=ec7a7821bf3d493ca26fcd92458c46d30c3acee6;hp=e06f71ab456f40d55825345ea413bc6981d10dd6;hb=d16185720fa344263367dbd50c61bfc8183d99a4;hpb=b42ed73a1b241c0e93ee03c43c4584b41c549bac diff --git a/source/strings/fmt.cpp b/source/strings/fmt.cpp index e06f71a..ec7a782 100644 --- a/source/strings/fmt.cpp +++ b/source/strings/fmt.cpp @@ -1,19 +1,12 @@ -/* $Id$ - -This file is part of libmspstrings -Copyright © 2006-2008 Mikko Rasa -Distributed under the LGPL -*/ - -#include #include "fmt.h" using namespace std; namespace Msp { -void Fmt::parse(const char *f) +void Fmt::parse(const char *s) { + const char *f = s; if(*f=='%') ++f; for(; *f; ++f) @@ -82,7 +75,7 @@ void Fmt::parse(const char *f) else if(*f=='i') base = AUTOBASE; else - throw InvalidParameterValue("Invalid conversion specifier"); + throw format_error(s); if(*f=='E' || *f=='F' || *f=='G' || *f=='X' || *f=='P') ucase = true; @@ -90,7 +83,7 @@ void Fmt::parse(const char *f) ++f; if(*f) - throw InvalidParameterValue("Extra characters in conversion specification"); + throw format_error(s); } Fmt &Fmt::reset()