ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/HostUpdate/HostUpdate.cpp
(Generate patch)

Comparing HostUpdate/HostUpdate.cpp (file contents):
Revision 17 by Douglas Thrift, 2003-11-10T11:08:33-08:00 vs.
Revision 21 by Douglas Thrift, 2003-11-10T20:16:12-08:00

# Line 6 | Line 6
6  
7   #include "HostUpdate.hpp"
8   #include "Host.hpp"
9 +
10 + #ifdef _WIN32
11   #include <windows.h>
12 + #endif
13  
14   int main(int argc, char* argv[])
15   {
# Line 42 | Line 45 | HostUpdate::HostUpdate()
45          }
46   }
47  
45 HostUpdate::~HostUpdate()
46 {
47        //
48 }
49
48   void HostUpdate::parse(const string& method)
49   {
50          string query;
# Line 145 | Line 143 | void HostUpdate::display()
143  
144          for (set<Host>::iterator itor = hosts.begin(); itor != hosts.end(); itor++)
145          {
146 <                Host host = *itor;
146 >                display(*itor);
147 >        }
148 > }
149 >
150 > void HostUpdate::display(const Host& host)
151 > {
152 >        cout << "host=" << host.getHost() << '\n'
153 >                << "name=" << host.getName() << '\n'
154 >                << "address=" << host.getAddress() << '\n'
155 >                << "platform=" << host.getPlatform() << '\n';
156 >
157 >        string name = string("hosts") + slash + host.getHost();
158 >        struct stat file;
159 >
160 >        if (stat(name.c_str(), &file) == 0)
161 >        {
162 >                char since[20];
163 >
164 >                strftime(since, 20, "%m/%d/%Y %H:%M:%S", gmtime(&file.st_mtime));
165  
166 <                cout << "host=" << host.getHost() << '\n'
151 <                        << "name=" << host.getName() << '\n'
152 <                        << "address=" << host.getAddress() << '\n'
153 <                        << "platform=" << host.getPlatform() << "\n\n";
166 >                cout << "since=" << since << " GMT\n";
167          }
168   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines