]> git.tdb.fi Git - libs/net.git/blobdiff - source/response.cpp
Prepare for assimilation into mspnet
[libs/net.git] / source / response.cpp
diff --git a/source/response.cpp b/source/response.cpp
deleted file mode 100644 (file)
index ede249b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <msp/strings/formatter.h>
-#include <msp/strings/utils.h>
-#include "response.h"
-
-using namespace std;
-
-namespace Msp {
-namespace Http {
-
-Response::Response(Status s):
-       status(s)
-{ }
-
-string Response::str() const
-{
-       string result = format("%s %d %s\r\n", version_str(http_version), static_cast<int>(status), status);
-       result += str_common();
-
-       return result;
-}
-
-Response Response::parse(const string &str)
-{
-       Response result;
-
-       unsigned lf = str.find('\n');
-       vector<string> parts = split(str.substr(0, lf), ' ', 2);
-       if(parts.size()<2)
-               throw invalid_argument("Response::parse");
-
-       result.http_version = parse_version(parts[0]);
-       result.status = static_cast<Status>(lexical_cast<unsigned>(parts[1]));
-
-       lf += result.parse_headers(str.substr(lf+1));
-
-       result.parse_content(str.substr(lf+1));
-
-       return result;
-}
-
-} // namespace Http
-} // namespace Msp