]> git.tdb.fi Git - builder.git/blobdiff - source/sourcepackage.cpp
Remove a useless path-to-string conversion
[builder.git] / source / sourcepackage.cpp
index a466089ae75aad13b049d5e5e3660a930f597ec3..4f42051e6b654d9baac64fabde7bb44e479e6ebe 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of builder
-Copyright © 2007-2010  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #include <cstdlib>
 #include <msp/io/print.h>
 #include <msp/strings/lexicalcast.h>
@@ -76,7 +69,7 @@ LibMode SourcePackage::get_library_mode() const
        else if(mode=="none")
                return DYNAMIC;
        else
-               throw Exception("Unknown library mode");
+               throw runtime_error("unknown library mode");
 }
 
 string SourcePackage::expand_string(const string &str) const
@@ -87,7 +80,7 @@ string SourcePackage::expand_string(const string &str) const
        while((dollar = result.find('$'))!=string::npos)
        {
                if(n>1000)
-                       throw Exception("Too much variable expansions");
+                       throw bad_expansion("nested too deep");
 
                string::size_type end;
                string var;
@@ -95,7 +88,7 @@ string SourcePackage::expand_string(const string &str) const
                {
                        end = result.find('}', dollar+2);
                        if(end==string::npos)
-                               throw Exception("Unterminated variable reference");
+                               throw bad_expansion("unterminated variable reference");
                        var = result.substr(dollar+2, end-dollar-2);
                        ++end;
                }