From b3a46697431c1fc071a87a6924d7f84e0b49c03f Mon Sep 17 00:00:00 2001 From: Chris McFarlen Date: Tue, 17 Sep 2024 17:35:05 -0500 Subject: [PATCH] Add const to cripts formatter format functions (#11777) --- include/cripts/Crypto.hpp | 6 +++--- include/cripts/Headers.hpp | 6 +++--- include/cripts/Lulu.hpp | 10 +++++----- include/cripts/Time.hpp | 2 +- include/cripts/Urls.hpp | 14 +++++++------- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/cripts/Crypto.hpp b/include/cripts/Crypto.hpp index bdbd958d98a..d4e4de29779 100644 --- a/include/cripts/Crypto.hpp +++ b/include/cripts/Crypto.hpp @@ -275,7 +275,7 @@ template <> struct formatter { template auto - format(cripts::Crypto::SHA256 &sha, FormatContext &ctx) -> decltype(ctx.out()) + format(cripts::Crypto::SHA256 &sha, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", sha.Hex()); } @@ -290,7 +290,7 @@ template <> struct formatter { template auto - format(cripts::Crypto::SHA512 &sha, FormatContext &ctx) -> decltype(ctx.out()) + format(cripts::Crypto::SHA512 &sha, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", sha.Hex()); } @@ -305,7 +305,7 @@ template <> struct formatter { template auto - format(cripts::Crypto::AES256 &sha, FormatContext &ctx) -> decltype(ctx.out()) + format(cripts::Crypto::AES256 &sha, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", cripts::Crypto::Base64::Encode(sha.Message())); } diff --git a/include/cripts/Headers.hpp b/include/cripts/Headers.hpp index eea7f5f1e97..ba448b02a1e 100644 --- a/include/cripts/Headers.hpp +++ b/include/cripts/Headers.hpp @@ -525,7 +525,7 @@ template <> struct formatter { template auto - format(cripts::Header::Method &method, FormatContext &ctx) -> decltype(ctx.out()) + format(cripts::Header::Method &method, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", method.GetSV()); } @@ -540,7 +540,7 @@ template <> struct formatter { template auto - format(cripts::Header::String &str, FormatContext &ctx) -> decltype(ctx.out()) + format(const cripts::Header::String &str, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", str.GetSV()); } @@ -555,7 +555,7 @@ template <> struct formatter { template auto - format(cripts::Header::Name &name, FormatContext &ctx) -> decltype(ctx.out()) + format(const cripts::Header::Name &name, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", name.GetSV()); } diff --git a/include/cripts/Lulu.hpp b/include/cripts/Lulu.hpp index 52c489051b1..f003d7714a7 100644 --- a/include/cripts/Lulu.hpp +++ b/include/cripts/Lulu.hpp @@ -549,7 +549,7 @@ template <> struct formatter { template auto - format(cripts::Versions &version, FormatContext &ctx) -> decltype(ctx.out()) + format(cripts::Versions &version, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", version.GetSV()); } @@ -564,7 +564,7 @@ template <> struct formatter { template auto - format(cripts::Versions::Major &major, FormatContext &ctx) -> decltype(ctx.out()) + format(cripts::Versions::Major &major, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", integer(major)); } @@ -579,7 +579,7 @@ template <> struct formatter { template auto - format(cripts::Versions::Minor &minor, FormatContext &ctx) -> decltype(ctx.out()) + format(cripts::Versions::Minor &minor, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", integer(minor)); } @@ -594,7 +594,7 @@ template <> struct formatter { template auto - format(cripts::Versions::Patch &patch, FormatContext &ctx) -> decltype(ctx.out()) + format(cripts::Versions::Patch &patch, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", integer(patch)); } @@ -609,7 +609,7 @@ template <> struct formatter { template auto - format(const TSHttpStatus &stat, FormatContext &ctx) -> decltype(ctx.out()) + format(const TSHttpStatus &stat, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", static_cast(stat)); } diff --git a/include/cripts/Time.hpp b/include/cripts/Time.hpp index 0ca61d6a0c6..9afc578cb04 100644 --- a/include/cripts/Time.hpp +++ b/include/cripts/Time.hpp @@ -139,7 +139,7 @@ template <> struct formatter { template auto - format(cripts::Time::Local &time, FormatContext &ctx) -> decltype(ctx.out()) + format(cripts::Time::Local &time, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", time.Epoch()); } diff --git a/include/cripts/Urls.hpp b/include/cripts/Urls.hpp index f44485ad2ca..c3d049112ed 100644 --- a/include/cripts/Urls.hpp +++ b/include/cripts/Urls.hpp @@ -785,7 +785,7 @@ template <> struct formatter { template auto - format(cripts::Url::Scheme &scheme, FormatContext &ctx) -> decltype(ctx.out()) + format(cripts::Url::Scheme &scheme, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", scheme.GetSV()); } @@ -800,7 +800,7 @@ template <> struct formatter { template auto - format(cripts::Url::Host &host, FormatContext &ctx) -> decltype(ctx.out()) + format(cripts::Url::Host &host, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", host.GetSV()); } @@ -815,7 +815,7 @@ template <> struct formatter { template auto - format(cripts::Url::Port &port, FormatContext &ctx) -> decltype(ctx.out()) + format(cripts::Url::Port &port, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", integer(port)); } @@ -830,7 +830,7 @@ template <> struct formatter { template auto - format(cripts::Url::Path::String &path, FormatContext &ctx) -> decltype(ctx.out()) + format(cripts::Url::Path::String &path, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", path.GetSV()); } @@ -845,7 +845,7 @@ template <> struct formatter { template auto - format(cripts::Url::Path &path, FormatContext &ctx) -> decltype(ctx.out()) + format(cripts::Url::Path &path, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", path.GetSV()); } @@ -860,7 +860,7 @@ template <> struct formatter { template auto - format(cripts::Url::Query::Parameter ¶m, FormatContext &ctx) -> decltype(ctx.out()) + format(cripts::Url::Query::Parameter ¶m, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", param.GetSV()); } @@ -875,7 +875,7 @@ template <> struct formatter { template auto - format(cripts::Url::Query &query, FormatContext &ctx) -> decltype(ctx.out()) + format(cripts::Url::Query &query, FormatContext &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", query.GetSV()); }