17 |
|
#include <ctime> |
18 |
|
#include <cstring> |
19 |
|
|
20 |
– |
using namespace std; |
21 |
– |
|
22 |
– |
extern "C" |
23 |
– |
{ |
20 |
|
#include <sys/types.h> |
21 |
|
#include <sys/stat.h> |
26 |
– |
} |
22 |
|
|
23 |
|
#ifndef _WIN32 |
24 |
|
|
30 |
– |
extern "C" |
31 |
– |
{ |
25 |
|
#include <unistd.h> |
26 |
|
#include <dirent.h> |
34 |
– |
} |
27 |
|
|
28 |
|
const char slash = '/'; |
29 |
|
|
30 |
|
inline int mkdir(const char* path) |
31 |
|
{ |
32 |
< |
return mkdir(path, S_IRUSR | S_IWUSR | S_IXUSR); |
32 |
> |
return ::mkdir(path, S_IRUSR | S_IWUSR | S_IXUSR); |
33 |
|
} |
34 |
|
|
35 |
|
#else |
40 |
|
|
41 |
|
#endif |
42 |
|
|
43 |
< |
inline string sgetenv(const string& name) |
43 |
> |
inline std::string sgetenv(const std::string& name) |
44 |
|
{ |
45 |
< |
char* value = getenv(name.c_str()); |
45 |
> |
char* value = ::getenv(name.c_str()); |
46 |
|
|
47 |
|
return value != NULL ? value : ""; |
48 |
|
} |
52 |
|
class HostUpdate |
53 |
|
{ |
54 |
|
private: |
55 |
< |
multimap<string, string> cgi; |
55 |
> |
std::multimap<std::string, std::string> cgi; |
56 |
|
bool host; |
57 |
|
bool name; |
58 |
|
bool address; |
59 |
|
bool platform; |
60 |
|
bool since; |
61 |
< |
void parse(const string& method); |
61 |
> |
void parse(const std::string& method); |
62 |
|
void mode(); |
63 |
< |
void update(const string& agent); |
63 |
> |
void update(const std::string& agent); |
64 |
|
void display(); |
65 |
|
void display(const Host& host); |
66 |
|
public: |