From b47e0cffddecaf7c23fa7ae4f3704ad714f834eb Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 30 Nov 2020 22:23:27 +0100 Subject: [PATCH] util/TemplateString: rename CharAsString() to FromChar() --- src/lib/dbus/Types.hxx | 12 ++++++------ src/util/TemplateString.hxx | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/dbus/Types.hxx b/src/lib/dbus/Types.hxx index 3319d04e3..99662dc45 100644 --- a/src/lib/dbus/Types.hxx +++ b/src/lib/dbus/Types.hxx @@ -42,7 +42,7 @@ namespace ODBus { template struct BasicTypeTraits { static constexpr int TYPE = type; - static constexpr auto as_string = TemplateString::CharAsString(TYPE); + static constexpr auto as_string = TemplateString::FromChar(TYPE); }; template @@ -74,7 +74,7 @@ struct ArrayTypeTraits { static constexpr int TYPE = DBUS_TYPE_ARRAY; static constexpr auto as_string = - TemplateString::Concat(TemplateString::CharAsString(TYPE), + TemplateString::Concat(TemplateString::FromChar(TYPE), ContainedTraits::as_string); }; @@ -83,10 +83,10 @@ struct DictEntryTypeTraits { static constexpr int TYPE = DBUS_TYPE_DICT_ENTRY; static constexpr auto as_string = - TemplateString::Concat(TemplateString::CharAsString(DBUS_DICT_ENTRY_BEGIN_CHAR), + TemplateString::Concat(TemplateString::FromChar(DBUS_DICT_ENTRY_BEGIN_CHAR), KeyT::as_string, ValueT::as_string, - TemplateString::CharAsString(DBUS_DICT_ENTRY_END_CHAR)); + TemplateString::FromChar(DBUS_DICT_ENTRY_END_CHAR)); }; using VariantTypeTraits = BasicTypeTraits; @@ -111,9 +111,9 @@ struct StructTypeTraits { static constexpr int TYPE = DBUS_TYPE_STRUCT; static constexpr auto as_string = - TemplateString::Concat(TemplateString::CharAsString(DBUS_STRUCT_BEGIN_CHAR), + TemplateString::Concat(TemplateString::FromChar(DBUS_STRUCT_BEGIN_CHAR), ConcatTypeAsString::as_string, - TemplateString::CharAsString(DBUS_STRUCT_END_CHAR)); + TemplateString::FromChar(DBUS_STRUCT_END_CHAR)); }; } /* namespace ODBus */ diff --git a/src/util/TemplateString.hxx b/src/util/TemplateString.hxx index 9878fcbe4..0c034fbba 100644 --- a/src/util/TemplateString.hxx +++ b/src/util/TemplateString.hxx @@ -63,7 +63,7 @@ Empty() noexcept * A string consisting of a single character. */ constexpr auto -CharAsString(char ch) noexcept +FromChar(char ch) noexcept { Buffer<1> result{}; result.value[0] = ch;