8 |
|
#define _HostUpdate_hpp_ |
9 |
|
|
10 |
|
#include <iostream> |
11 |
< |
#include <cgicc/Cgicc.h> |
11 |
> |
#include <fstream> |
12 |
> |
#include <string> |
13 |
> |
#include <sstream> |
14 |
> |
#include <set> |
15 |
> |
#include <map> |
16 |
> |
#include <cstdlib> |
17 |
> |
#include <ctime> |
18 |
> |
|
19 |
> |
using namespace std; |
20 |
|
|
21 |
|
#include <sys/types.h> |
22 |
|
#include <sys/stat.h> |
24 |
|
#ifndef _WIN32 |
25 |
|
|
26 |
|
#include <unistd.h> |
27 |
+ |
#include <dirent.h> |
28 |
+ |
|
29 |
+ |
const char slash = '/'; |
30 |
+ |
|
31 |
+ |
inline int mkdir(const char* path) |
32 |
+ |
{ |
33 |
+ |
return mkdir(path, S_IRUSR | S_IWUSR | S_IXUSR); |
34 |
+ |
} |
35 |
|
|
36 |
|
#else |
37 |
|
|
38 |
|
#include <direct.h> |
39 |
|
|
40 |
+ |
const char slash = '\\'; |
41 |
+ |
|
42 |
|
#endif |
43 |
|
|
44 |
< |
using namespace std; |
45 |
< |
using namespace cgicc; |
44 |
> |
inline string sgetenv(const string& name) |
45 |
> |
{ |
46 |
> |
char* value = getenv(name.c_str()); |
47 |
> |
|
48 |
> |
return value != NULL ? value : ""; |
49 |
> |
} |
50 |
|
|
51 |
|
class HostUpdate |
52 |
|
{ |
53 |
|
private: |
54 |
< |
Cgicc cgi; |
55 |
< |
void update(CgiEnvironment& env, const string& agent); |
56 |
< |
void display(CgiEnvironment& env); |
54 |
> |
multimap<string, string> cgi; |
55 |
> |
void parse(const string& method); |
56 |
> |
void update(const string& agent); |
57 |
> |
void display(); |
58 |
|
public: |
59 |
|
HostUpdate(); |
60 |
|
~HostUpdate(); |