12 |
|
#include <sstream> |
13 |
|
#include <vector> |
14 |
|
#include <map> |
15 |
+ |
#include <cctype> |
16 |
|
|
17 |
|
using namespace std; |
18 |
|
|
25 |
|
return value != NULL ? value : ""; |
26 |
|
} |
27 |
|
|
28 |
+ |
inline int sputenv(const string& env) |
29 |
+ |
{ |
30 |
+ |
istringstream input(env); |
31 |
+ |
string name, value; |
32 |
+ |
|
33 |
+ |
getline(input, name, '='); |
34 |
+ |
getline(input, value); |
35 |
+ |
|
36 |
+ |
return setenv(name.c_str(), value.c_str(), true); |
37 |
+ |
} |
38 |
+ |
|
39 |
+ |
inline void sunsetenv(const string& name) { unsetenv(name.c_str()); } |
40 |
+ |
|
41 |
+ |
class Person; |
42 |
+ |
|
43 |
|
class Smersh |
44 |
|
{ |
45 |
|
private: |
46 |
|
multimap<string, string> cgi; |
47 |
< |
void parse(const string& method); |
47 |
> |
void parse(istream& sin); |
48 |
> |
void smersh(ostream& sout); |
49 |
> |
void output(ostream& sout, const vector<Person>& people); |
50 |
|
public: |
51 |
< |
Smersh(ostream& sout = cout); |
51 |
> |
Smersh(istream& sin = cin, ostream& sout = cout); |
52 |
|
~Smersh() {} |
53 |
|
}; |
54 |
|
|