X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fversion.cpp;fp=source%2Fversion.cpp;h=0000000000000000000000000000000000000000;hb=cf8d2e48581eeb8f1b83e8c48321a0bc2ffa6d83;hp=f22b46eafe92523497d25403c3c772fd1fe46676;hpb=d683ca0964182e9579838fec8d7d100eeabddee0;p=libs%2Fnet.git diff --git a/source/version.cpp b/source/version.cpp deleted file mode 100644 index f22b46e..0000000 --- a/source/version.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include -#include -#include -#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(match[1].str)<<4 | lexical_cast(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