X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fstrings%2Ffmt.cpp;h=ec7a7821bf3d493ca26fcd92458c46d30c3acee6;hp=e06f71ab456f40d55825345ea413bc6981d10dd6;hb=967785734be5c3fc6f75da122c2d93ebbb338271;hpb=b56eb5ec1da675da0c66abc53c1e4f6c4e4cccbd 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()