]> git.tdb.fi Git - libs/net.git/blobdiff - source/version.cpp
Use maputils.h
[libs/net.git] / source / version.cpp
index 2966fe8495ab04d6dbb0a03e6a859c2a27a5886d..f22b46eafe92523497d25403c3c772fd1fe46676 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmsphttp
-Copyright © 2008  Mikkosoft Productions, Mikko Rasa
-Distributed under the LGPL
-*/
-
 #include <msp/strings/formatter.h>
 #include <msp/strings/lexicalcast.h>
 #include <msp/strings/regex.h>
@@ -17,10 +10,10 @@ namespace Http {
 
 Version parse_version(const std::string &ver)
 {
-       if(RegMatch match=Regex("^HTTP/([0-9]+).([0-9]+)$").match(ver))
+       if(RegMatch match = Regex("^HTTP/([0-9]+).([0-9]+)$").match(ver))
                return lexical_cast<unsigned>(match[1].str)<<4 | lexical_cast<unsigned>(match[2].str);
        else
-               throw InvalidParameterValue("Invalid HTTP version");
+               throw invalid_argument("parse_version");
 }
 
 string version_str(Version ver)