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

@ -387,6 +387,18 @@ flags_keep_unmutable(Flags old_flags, Flags new_flags, Flags unmutable_flag)
*/
std::string to_string(Flags flags);
/**
* Get a string representation of Flags for fmt
*
* @param flags flags
*
* @return string as a sequence of message-flag shortcuts
*/
static inline auto format_as(const Flags& flags) {
return to_string(flags);
}
} // namespace Mu
#endif /* MU_FLAGS_HH__ */