--- HostStatus/HostStatus.cpp 2003/11/15 09:06:43 34 +++ HostStatus/HostStatus.cpp 2003/11/15 09:40:10 35 @@ -28,14 +28,7 @@ HostStatus::HostStatus() { string format = itor->second; - if (format == "t") - { - this->format = table; - } - else - { - this->format = page; - } + page = format != "t" ? true : false; } display(method); @@ -89,8 +82,7 @@ void HostStatus::display(const string& m hostupdate << '\n' << flush; } - hostupdate.ignore(string::npos, '\n'); - hostupdate.ignore(string::npos, '\n'); + hostupdate.ignore(26); list hosts; bool done = false; @@ -118,7 +110,7 @@ void HostStatus::display(const string& m } while (!done && hostupdate.good()); - if (format == page) header(); + if (page) header(); for (list::iterator itor = hosts.begin(); itor != hosts.end(); itor++) { @@ -127,5 +119,24 @@ void HostStatus::display(const string& m cout << host << flush; } - if (format == page) footer(); + if (page) footer(); +} + +void HostStatus::header() +{ + cout << "\n" + << "\n" + << "\n" + << "Host Status\n" + << "\n" + << "\n" + << "

Host Status

\n" + << "\n"; +} + +void HostStatus::footer() +{ + cout << "
\n" + << "\n"; }