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 |
|
} |