client/Response: add method Fmt() based on libfmt

This commit is contained in:
Max Kellermann
2021-05-21 20:35:29 +02:00
parent a9c704b76e
commit 0440c41cba
27 changed files with 241 additions and 195 deletions

View File

@@ -48,6 +48,8 @@
#include "StickerCommands.hxx"
#endif
#include <fmt/format.h>
#include <cassert>
#include <iterator>
@@ -253,7 +255,7 @@ PrintAvailableCommands(Response &r, const Partition &partition,
if (cmd->permission == (permission & cmd->permission) &&
command_available(partition, cmd))
r.Format("command: %s\n", cmd->cmd);
r.Fmt(FMT_STRING("command: {}\n"), cmd->cmd);
}
return CommandResult::OK;
@@ -266,7 +268,7 @@ PrintUnavailableCommands(Response &r, unsigned permission) noexcept
const struct command *cmd = &i;
if (cmd->permission != (permission & cmd->permission))
r.Format("command: %s\n", cmd->cmd);
r.Fmt(FMT_STRING("command: {}\n"), cmd->cmd);
}
return CommandResult::OK;