MetadataSummaryForService.h
Go to the documentation of this file.
1 #ifndef art_Framework_Art_detail_md_summary_MetadataSummaryForService_h
2 #define art_Framework_Art_detail_md_summary_MetadataSummaryForService_h
3 
7 
8 #include <iomanip>
9 #include <sstream>
10 #include <string>
11 
12 namespace art::detail {
13 
14  template <>
16  public:
18  : widths_{std::to_string(coll.size()).size(),
19  columnWidth(coll, &LibraryInfo::short_spec, "Service"),
20  columnWidth(coll, &LibraryInfo::provider, "Provider"),
21  columnWidth(coll, &LibraryInfo::path, "Source location")}
22  {}
23 
24  private:
26  Widths const&
27  doWidths() const override
28  {
29  return widths_;
30  }
31 
33  doHeader() const override
34  {
35  std::ostringstream result;
36  result << indent(widths_[0] + 2) << std::setw(widths_[1] + 4) << std::left
37  << "Service" << std::setw(widths_[2] + 4) << std::left
38  << "Provider" << std::left << "Source location";
39  return result.str();
40  }
41 
42  Summary
43  doSummary(LibraryInfo const& li, std::size_t const entry) const override
44  {
45  std::ostringstream result;
46  result << std::setw(widths_[0]) << std::right << entry << ". "
47  << std::setw(widths_[1] + 4) << std::left << li.short_spec()
48  << std::setw(widths_[2] + 4) << std::left << li.provider()
49  << std::left << li.path() << "\n";
50  return {result.str(), false};
51  }
52  };
53 
54 } // namespace art::detail
55 
56 #endif /* art_Framework_Art_detail_md_summary_MetadataSummaryForService_h */
57 
58 // Local variables:
59 // mode: c++
60 // End:
std::vector< std::size_t > Widths
QList< Entry > entry
static QCString result
std::string string
Definition: nybbler.cc:12
std::size_t columnWidth(T const &coll, std::string const Elem::*cp, std::string const &header)
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
Summary doSummary(LibraryInfo const &li, std::size_t const entry) const override
std::string indent(std::size_t const i)
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
std::string const & short_spec() const
Definition: LibraryInfo.h:43
std::string const & provider() const
Definition: LibraryInfo.h:63
std::string const & path() const
Definition: LibraryInfo.h:53
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34
std::multiset< LibraryInfo > LibraryInfoCollection