Changeset 10306


Ignore:
Timestamp:
Apr 7, 2011, 3:42:46 PM (9 years ago)
Author:
tbretz
Message:
Implemented GetComment and GetDescription member functions.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

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

    r10298 r10306  
    367367string ServiceList::GetFormat(const string &service) const
    368368{
    369     StringMap::const_iterator i = fFormatList.find(service);
     369    const StringMap::const_iterator i = fFormatList.find(service);
    370370    return i==fFormatList.end() ? "" : i->second;
    371371}
     
    388388{
    389389    return GetFormat(server+"/"+name);
     390}
     391
     392// --------------------------------------------------------------------------
     393//
     394//! Get the Description vector of a command or service
     395//!
     396//! @param service
     397//!    full qualified service name, e.g. SERVER/EXIT
     398//!
     399//! @returns
     400//!    a vector of Description objects corresponding to the arguments
     401//!
     402//
     403vector<Description> ServiceList::GetDescriptions(const string &service) const
     404{
     405    const DescriptionMap::const_iterator i = fDescriptionList.find(service);
     406    return i==fDescriptionList.end() ? vector<Description>() : i->second;
     407}
     408
     409// --------------------------------------------------------------------------
     410//
     411//! Get the Description vector of a command or service
     412//!
     413//! @param server
     414//!     the server name, e.g. SERVER
     415//!
     416//! @param name
     417//!     the service name, e.g. EXIT
     418//!
     419//! @returns
     420//!    a vector of Description objects corresponding to the arguments
     421//
     422vector<Description> ServiceList::GetDescriptions(const string &server, const string &name) const
     423{
     424    return GetDescriptions(server+"/"+name);
     425}
     426
     427// --------------------------------------------------------------------------
     428//
     429//! Get a description describing the given command or service if available.
     430//!
     431//! @param service
     432//!    full qualified service name, e.g. SERVER/EXIT
     433//!
     434//! @returns
     435//!    string with the stored comment
     436//!
     437//
     438string ServiceList::GetComment(const string &service) const
     439{
     440    const StringMap::const_iterator i = fDescriptionMap.find(service);
     441    return i==fDescriptionMap.end() ? "" : i->second;
     442}
     443
     444// --------------------------------------------------------------------------
     445//
     446//! Get a description describing the given command or service if available.
     447//!
     448//! @param server
     449//!     the server name, e.g. SERVER
     450//!
     451//! @param name
     452//!     the service name, e.g. EXIT
     453//!
     454//! @returns
     455//!    string with the stored comment
     456//
     457string ServiceList::GetComment(const string &server, const string &name) const
     458{
     459    return GetComment(server+"/"+name);
    390460}
    391461
  • trunk/FACT++/src/ServiceList.h

    r10298 r10306  
    6969    std::string GetFormat(const std::string &service) const;
    7070
     71    std::string GetComment(const std::string &server, const std::string &name) const;
     72    std::string GetComment(const std::string &service) const;
     73
     74    std::vector<Description> GetDescriptions(const std::string &server, const std::string &name) const;
     75    std::vector<Description> GetDescriptions(const std::string &service) const;
     76
    7177    void PrintServerList(std::ostream &out) const;
    7278    void PrintServiceList(std::ostream &out) const;
Note: See TracChangeset for help on using the changeset viewer.