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

Comparing HostStatus/HostStatus.cpp (file contents):
Revision 32 by Douglas Thrift, 2003-11-14T23:44:08-08:00 vs.
Revision 34 by Douglas Thrift, 2003-11-15T01:06:43-08:00

# Line 89 | Line 89 | void HostStatus::display(const string& m
89                  hostupdate << '\n' << flush;
90          }
91  
92 < /*      do
92 >        hostupdate.ignore(string::npos, '\n');
93 >        hostupdate.ignore(string::npos, '\n');
94 >
95 >        list<Host> hosts;
96 >        bool done = false;
97 >
98 >        do
99          {
100 <                string line;
100 >                Host host;
101 >
102 >                hostupdate >> host;
103  
104 <                getline(hostupdate, line);
104 >                hosts.push_back(host);
105  
106 <                cout << line << '\n';
106 >                switch (hostupdate.peek())
107 >                {
108 >                case 'h':
109 >                case 'n':
110 >                case 'a':
111 >                case 'p':
112 >                case 's':
113 >                        break;
114 >                default:
115 >                        done = true;
116 >                        break;
117 >                }
118          }
119 <        while (hostupdate.good());*/
119 >        while (!done && hostupdate.good());
120 >
121 >        if (format == page) header();
122 >
123 >        for (list<Host>::iterator itor = hosts.begin(); itor != hosts.end(); itor++)
124 >        {
125 >                Host host = *itor;
126 >
127 >                cout << host << flush;
128 >        }
129 >
130 >        if (format == page) footer();
131   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines