message & friends: make formattable

So we can easily debug-print them.
This commit is contained in:
Dirk-Jan C. Binnema
2023-08-09 20:06:03 +03:00
parent 4dcd457b7f
commit 04219b55f7
4 changed files with 38 additions and 9 deletions

View File

@ -109,7 +109,7 @@ QueryMatch::has_flag(QueryMatch::Flags flag) const
return any_of(flags & flag);
}
inline std::ostream&
static inline std::ostream&
operator<<(std::ostream& os, QueryMatch::Flags mflags)
{
if (mflags == QueryMatch::Flags::None) {
@ -348,6 +348,13 @@ private:
QueryMatches& query_matches_;
};
static inline auto
format_as(const QueryResultsIterator& it)
{
return it.path().value_or("<no path>");
}
constexpr auto MaxQueryResultsSize = std::numeric_limits<size_t>::max();
class QueryResults {