]> git.tdb.fi Git - libs/net.git/blobdiff - source/http/submessage.cpp
Add a class for parsing submitted form data
[libs/net.git] / source / http / submessage.cpp
diff --git a/source/http/submessage.cpp b/source/http/submessage.cpp
new file mode 100644 (file)
index 0000000..05b1a30
--- /dev/null
@@ -0,0 +1,24 @@
+#include "submessage.h"
+
+using namespace std;
+
+namespace Msp {
+namespace Http {
+
+string SubMessage::str() const
+{
+       return str_common();
+}
+
+SubMessage SubMessage::parse(const string &str)
+{
+       SubMessage result;
+
+       string::size_type pos = result.parse_headers(str);
+       result.content = str.substr(pos);
+
+       return result;
+}
+
+} // namespace Http
+} // namespace Msp