]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/loader.h
Require mspcore instead of mspmisc
[libs/datafile.git] / source / loader.h
index c6936f96f6eef5869f62ffe3ed9307f34038dd2c..39a50d0b7fe4a56b88a28ec1be68c82e78ed0d5e 100644 (file)
@@ -8,7 +8,7 @@ Distributed under the LGPL
 
 #include <fstream>
 #include <map>
-#include <msp/error.h>
+#include "error.h"
 #include "parser.h"
 #include "statement.h"
 #include "value.h"
@@ -37,7 +37,7 @@ public:
        LoaderFunc0(FuncType f): func(f) { }
        void execute(Loader &l, const Statement &st) const
        {
-               if(st.args.size()!=0) throw TypeError("Wrong number of arguments");
+               if(st.args.size()!=0) throw TypeError(st.get_location()+": Wrong number of arguments");
                (dynamic_cast<L &>(l).*func)();
        };
 private:
@@ -53,7 +53,7 @@ public:
        LoaderFunc1(FuncType f): func(f) { }
        void execute(Loader &l, const Statement &st) const
        {
-               if(st.args.size()!=1) throw TypeError("Wrong number of arguments");
+               if(st.args.size()!=1) throw TypeError(st.get_location()+": Wrong number of arguments");
                (dynamic_cast<L &>(l).*func)(st.args[0].get<A0>());
        }
 private:
@@ -69,7 +69,7 @@ public:
        LoaderFunc2(FuncType f): func(f) { }
        void execute(Loader &l, const Statement &st) const
        {
-               if(st.args.size()!=2) throw TypeError("Wrong number of arguments");
+               if(st.args.size()!=2) throw TypeError(st.get_location()+": Wrong number of arguments");
                (dynamic_cast<L &>(l).*func)(st.args[0].get<A0>(), st.args[1].get<A1>());
        }
 private:
@@ -85,7 +85,7 @@ public:
        LoaderFunc3(FuncType f): func(f) { }
        void execute(Loader &l, const Statement &st) const
        {
-               if(st.args.size()!=3) throw TypeError("Wrong number of arguments");
+               if(st.args.size()!=3) throw TypeError(st.get_location()+": Wrong number of arguments");
                (dynamic_cast<L &>(l).*func)(st.args[0].get<A0>(), st.args[1].get<A1>(), st.args[2].get<A2>());
        }
 private:
@@ -101,7 +101,7 @@ public:
        LoaderFunc4(FuncType f): func(f) { }
        void execute(Loader &l, const Statement &st) const
        {
-               if(st.args.size()!=4) throw TypeError("Wrong number of arguments");
+               if(st.args.size()!=4) throw TypeError(st.get_location()+": Wrong number of arguments");
                (dynamic_cast<L &>(l).*func)(st.args[0].get<A0>(), st.args[1].get<A1>(), st.args[2].get<A2>(), st.args[3].get<A3>());
        }
 private:
@@ -117,7 +117,7 @@ public:
        LoadValue(PointerType p): ptr(p) { }
        void execute(Loader &l, const Statement &st) const
        {
-               if(st.args.size()!=1) throw TypeError("Wrong number of arguments");
+               if(st.args.size()!=1) throw TypeError(st.get_location()+": Wrong number of arguments");
                dynamic_cast<typename L::Loader &>(l).get_object().*ptr=st.args[0].get<T>();
        }
 private: