]> git.tdb.fi Git - libs/core.git/blobdiff - source/strings/fmt.cpp
Exception changes for Fmt and Formatter
[libs/core.git] / source / strings / fmt.cpp
index e06f71ab456f40d55825345ea413bc6981d10dd6..7026fe0772c690830d7e0811910f0ec006b8c940 100644 (file)
@@ -5,15 +5,15 @@ Copyright © 2006-2008 Mikko Rasa
 Distributed under the LGPL
 */
 
-#include <msp/core/except.h>
 #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 +82,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 +90,7 @@ void Fmt::parse(const char *f)
        ++f;
 
        if(*f)
-               throw InvalidParameterValue("Extra characters in conversion specification");
+               throw format_error(s);
 }
 
 Fmt &Fmt::reset()