MetadataSummaryForMFPlugin.h
Go to the documentation of this file.
1 #ifndef art_Framework_Art_detail_md_summary_MetadataSummaryForMFPlugin_h
2 #define art_Framework_Art_detail_md_summary_MetadataSummaryForMFPlugin_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, "Destination type"),
20  columnWidth(coll, &LibraryInfo::path, "Source location")}
21  {}
22 
23  private:
25  Widths const&
26  doWidths() const override
27  {
28  return widths_;
29  }
30 
32  doHeader() const override
33  {
34  std::ostringstream result;
35  result << indent(widths_[0] + 2) << std::setw(widths_[1] + 4) << std::left
36  << "Destination type" << std::left << "Source location";
37  return result.str();
38  }
39 
40  Summary
41  doSummary(LibraryInfo const& li, std::size_t const entry) const override
42  {
43  std::ostringstream result;
44  result << std::setw(widths_[0]) << std::right << entry << ". "
45  << std::setw(widths_[1] + 4) << std::left << li.short_spec()
46  << std::left << li.path() << "\n";
47  return {result.str(), false};
48  }
49  };
50 
51 } // namespace art::detail
52 
53 #endif /* art_Framework_Art_detail_md_summary_MetadataSummaryForMFPlugin_h */
54 
55 // Local variables:
56 // mode: c++
57 // End:
std::vector< std::size_t > Widths
QList< Entry > entry
static QCString result
Summary doSummary(LibraryInfo const &li, std::size_t const entry) const override
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
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 & path() const
Definition: LibraryInfo.h:53
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34
std::multiset< LibraryInfo > LibraryInfoCollection