ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/HostUpdate/HostUpdate.hpp
Revision: 17
Committed: 2003-11-10T11:08:33-08:00 (21 years, 7 months ago) by Douglas Thrift
File size: 815 byte(s)
Log Message:
It works on Windows again.

File Contents

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

Properties

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