Ignore:
Timestamp:
04/10/11 10:10:36 (14 years ago)
Author:
tbretz
Message:
Added server and service argument to PrintDescription.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/ServiceList.cc

    r10330 r10339  
    607607//!    ostream to which the output is send.
    608608//
    609 void ServiceList::PrintDescription(std::ostream &out) const
    610 {
     609int ServiceList::PrintDescription(std::ostream &out, const string &serv, const string &service) const
     610{
     611    int rc = 0;
    611612    for (ServiceMap::const_iterator i=fServiceList.begin(); i!=fServiceList.end(); i++)
    612613    {
    613614        const string &server = i->first;
     615
     616        if (!serv.empty() && server!=serv)
     617            continue;
     618
     619        out << "" << kRed << "----- " << server << " -----" << endl;
     620
    614621        const vector<string> &lst = i->second;
    615 
    616         out << "" << kRed << "----- " << server << " -----" << endl;
    617 
    618622        for (vector<string>::const_iterator s=lst.begin(); s!=lst.end(); s++)
    619623        {
     624            if (!service.empty() && *s!=service)
     625                continue;
     626
     627            rc++;
     628
    620629            out << " " << *s;
    621630
     
    655664        out << endl;
    656665    }
     666
     667    return rc;
    657668}
    658669
Note: See TracChangeset for help on using the changeset viewer.