]> git.tdb.fi Git - libs/net.git/blobdiff - source/version.cpp
Prepare for assimilation into mspnet
[libs/net.git] / source / version.cpp
diff --git a/source/version.cpp b/source/version.cpp
deleted file mode 100644 (file)
index f22b46e..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <msp/strings/formatter.h>
-#include <msp/strings/lexicalcast.h>
-#include <msp/strings/regex.h>
-#include "version.h"
-
-using namespace std;
-
-namespace Msp {
-namespace Http {
-
-Version parse_version(const std::string &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 invalid_argument("parse_version");
-}
-
-string version_str(Version ver)
-{
-       return format("HTTP/%u.%u", (ver>>4)&0xF, ver&0xF);
-}
-
-} // namespace Http
-} // namespace Msp