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 19 by Douglas Thrift, 2003-11-10T19:46:19-08:00 vs.
Revision 20 by Douglas Thrift, 2003-11-10T20:11:13-08:00

# Line 42 | Line 42 | HostUpdate::HostUpdate()
42          }
43   }
44  
45 HostUpdate::~HostUpdate()
46 {
47        //
48 }
49
45   void HostUpdate::parse(const string& method)
46   {
47          string query;
# Line 145 | Line 140 | void HostUpdate::display()
140  
141          for (set<Host>::iterator itor = hosts.begin(); itor != hosts.end(); itor++)
142          {
143 <                Host host = *itor;
143 >                display(*itor);
144 >        }
145 > }
146  
147 <                cout << "host=" << host.getHost() << '\n'
148 <                        << "name=" << host.getName() << '\n'
149 <                        << "address=" << host.getAddress() << '\n'
150 <                        << "platform=" << host.getPlatform() << '\n';
147 > void HostUpdate::display(const Host& host)
148 > {
149 >        cout << "host=" << host.getHost() << '\n'
150 >                << "name=" << host.getName() << '\n'
151 >                << "address=" << host.getAddress() << '\n'
152 >                << "platform=" << host.getPlatform() << '\n';
153  
154 <                string name = string("hosts") + slash + host.getHost();
155 <                struct stat file;
154 >        string name = string("hosts") + slash + host.getHost();
155 >        struct stat file;
156  
157 <                if (stat(name.c_str(), &file) == 0)
158 <                {
159 <                        char since[20];
157 >        if (stat(name.c_str(), &file) == 0)
158 >        {
159 >                char since[20];
160  
161 <                        strftime(since, 20, "%m/%d/%Y %H:%M:%S", gmtime(&file.st_mtime));
161 >                strftime(since, 20, "%m/%d/%Y %H:%M:%S", gmtime(&file.st_mtime));
162  
163 <                        cout << "since=" << since << " GMT\n";
165 <                }
163 >                cout << "since=" << since << " GMT\n";
164          }
165   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines