Skip to content

Commit

Permalink
Add const to cripts formatter format functions (#11777)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmcfarlen authored Sep 17, 2024
1 parent aeb144d commit b3a4669
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions include/cripts/Crypto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ template <> struct formatter<cripts::Crypto::SHA256> {

template <typename FormatContext>
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());
}
Expand All @@ -290,7 +290,7 @@ template <> struct formatter<cripts::Crypto::SHA512> {

template <typename FormatContext>
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());
}
Expand All @@ -305,7 +305,7 @@ template <> struct formatter<cripts::Crypto::AES256> {

template <typename FormatContext>
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()));
}
Expand Down
6 changes: 3 additions & 3 deletions include/cripts/Headers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ template <> struct formatter<cripts::Header::Method> {

template <typename FormatContext>
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());
}
Expand All @@ -540,7 +540,7 @@ template <> struct formatter<cripts::Header::String> {

template <typename FormatContext>
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());
}
Expand All @@ -555,7 +555,7 @@ template <> struct formatter<cripts::Header::Name> {

template <typename FormatContext>
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());
}
Expand Down
10 changes: 5 additions & 5 deletions include/cripts/Lulu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ template <> struct formatter<cripts::Versions> {

template <typename FormatContext>
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());
}
Expand All @@ -564,7 +564,7 @@ template <> struct formatter<cripts::Versions::Major> {

template <typename FormatContext>
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));
}
Expand All @@ -579,7 +579,7 @@ template <> struct formatter<cripts::Versions::Minor> {

template <typename FormatContext>
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));
}
Expand All @@ -594,7 +594,7 @@ template <> struct formatter<cripts::Versions::Patch> {

template <typename FormatContext>
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));
}
Expand All @@ -609,7 +609,7 @@ template <> struct formatter<TSHttpStatus> {

template <typename FormatContext>
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<int>(stat));
}
Expand Down
2 changes: 1 addition & 1 deletion include/cripts/Time.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ template <> struct formatter<cripts::Time::Local> {

template <typename FormatContext>
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());
}
Expand Down
14 changes: 7 additions & 7 deletions include/cripts/Urls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ template <> struct formatter<cripts::Url::Scheme> {

template <typename FormatContext>
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());
}
Expand All @@ -800,7 +800,7 @@ template <> struct formatter<cripts::Url::Host> {

template <typename FormatContext>
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());
}
Expand All @@ -815,7 +815,7 @@ template <> struct formatter<cripts::Url::Port> {

template <typename FormatContext>
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));
}
Expand All @@ -830,7 +830,7 @@ template <> struct formatter<cripts::Url::Path::String> {

template <typename FormatContext>
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());
}
Expand All @@ -845,7 +845,7 @@ template <> struct formatter<cripts::Url::Path> {

template <typename FormatContext>
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());
}
Expand All @@ -860,7 +860,7 @@ template <> struct formatter<cripts::Url::Query::Parameter> {

template <typename FormatContext>
auto
format(cripts::Url::Query::Parameter &param, FormatContext &ctx) -> decltype(ctx.out())
format(cripts::Url::Query::Parameter &param, FormatContext &ctx) const -> decltype(ctx.out())
{
return fmt::format_to(ctx.out(), "{}", param.GetSV());
}
Expand All @@ -875,7 +875,7 @@ template <> struct formatter<cripts::Url::Query> {

template <typename FormatContext>
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());
}
Expand Down

0 comments on commit b3a4669

Please sign in to comment.