ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/Smersh/Smersh.cpp
Revision: 164
Committed: 2004-06-17T22:12:33-07:00 (21 years ago) by Douglas Thrift
File size: 726 byte(s)
Log Message:
Wow, that's a lot of stuff. Too bad it doesn't do anything yet.

File Contents

# User Rev Content
1 Douglas Thrift 162 // Smersh
2     //
3     // Douglas Thrift
4     //
5     // $Id$
6    
7     #include "Smersh.hpp"
8 Douglas Thrift 164 #include "Matcher.hpp"
9 Douglas Thrift 162
10     int main(int argc, char* argv[])
11     {
12     Smersh smersh;
13    
14     return 0;
15     }
16    
17 Douglas Thrift 164 Smersh::Smersh(ostream& sout)
18 Douglas Thrift 162 {
19     string method = sgetenv("REQUEST_METHOD");
20    
21     parse(method);
22    
23 Douglas Thrift 164 sout << "Content-Type: text/plain\n\n" << (cgi.find("sn") != cgi.end() ?
24 Douglas Thrift 162 cgi.find("sn")->second : "Unknown") << '\n';
25     }
26    
27     void Smersh::parse(const string& method)
28     {
29     string query(sgetenv("QUERY_STRING"));
30    
31     if (method == "POST") getline(cin, query);
32     if (query == "") return;
33    
34     istringstream input(query);
35    
36     do
37     {
38     string name, value;
39    
40     getline(input, name, '=');
41     getline(input, value, '&');
42    
43     cgi.insert(pair<string, string>(name, value));
44     }
45     while (input.good());
46     }

Properties

Name Value
svn:eol-style native
svn:keywords Id