summaryrefslogtreecommitdiffstats
path: root/src/format.hpp
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-08-31 09:33:09 -0700
committerPatrick Venture <venture@google.com>2018-09-04 16:43:17 -0700
commit3d6d3182ee0b0e88b81fbbbe5c91dea3e99425a9 (patch)
treee4ce167e617e988157a6ea8bfa9de579ebfcf0b8 /src/format.hpp
parentac8039592ad4b58edbf79900bf41a1faabea3fa2 (diff)
downloadphosphor-dbus-monitor-3d6d3182ee0b0e88b81fbbbe5c91dea3e99425a9.tar.gz
phosphor-dbus-monitor-3d6d3182ee0b0e88b81fbbbe5c91dea3e99425a9.zip
update .clang-format
Added the header inclusion order to the .clang-format file generated these changes. Change-Id: I4f51a20f469de431ee6a5ba78e3f4da39c980fab Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'src/format.hpp')
-rw-r--r--src/format.hpp48
1 files changed, 32 insertions, 16 deletions
diff --git a/src/format.hpp b/src/format.hpp
index f622f2e..32a85f8 100644
--- a/src/format.hpp
+++ b/src/format.hpp
@@ -12,62 +12,77 @@ namespace detail
{
/** @brief Map format strings to undecorated C++ types. */
-template <typename T> struct GetFormatType
+template <typename T>
+struct GetFormatType
{
};
-template <> struct GetFormatType<bool>
+template <>
+struct GetFormatType<bool>
{
static constexpr auto format = "%d";
};
-template <> struct GetFormatType<char>
+template <>
+struct GetFormatType<char>
{
static constexpr auto format = "=%hhd";
};
-template <> struct GetFormatType<short int>
+template <>
+struct GetFormatType<short int>
{
static constexpr auto format = "=%hd";
};
-template <> struct GetFormatType<int>
+template <>
+struct GetFormatType<int>
{
static constexpr auto format = "=%d";
};
-template <> struct GetFormatType<long int>
+template <>
+struct GetFormatType<long int>
{
static constexpr auto format = "=%ld";
};
-template <> struct GetFormatType<long long int>
+template <>
+struct GetFormatType<long long int>
{
static constexpr auto format = "=%lld";
};
-template <> struct GetFormatType<unsigned char>
+template <>
+struct GetFormatType<unsigned char>
{
static constexpr auto format = "=%hhd";
};
-template <> struct GetFormatType<unsigned short int>
+template <>
+struct GetFormatType<unsigned short int>
{
static constexpr auto format = "=%hd";
};
-template <> struct GetFormatType<unsigned int>
+template <>
+struct GetFormatType<unsigned int>
{
static constexpr auto format = "=%d";
};
-template <> struct GetFormatType<unsigned long int>
+template <>
+struct GetFormatType<unsigned long int>
{
static constexpr auto format = "=%ld";
};
-template <> struct GetFormatType<unsigned long long int>
+template <>
+struct GetFormatType<unsigned long long int>
{
static constexpr auto format = "=%lld";
};
-template <> struct GetFormatType<std::string>
+template <>
+struct GetFormatType<std::string>
{
static constexpr auto format = "=%s";
};
-template <> struct GetFormatType<char*>
+template <>
+struct GetFormatType<char*>
{
static constexpr auto format = "=%s";
};
-template <> struct GetFormatType<const char*>
+template <>
+struct GetFormatType<const char*>
{
static constexpr auto format = "=%s";
};
@@ -75,7 +90,8 @@ template <> struct GetFormatType<const char*>
} // namespace detail
/** @brief Get the format string for a C++ type. */
-template <typename T> struct GetFormat
+template <typename T>
+struct GetFormat
{
static constexpr auto format =
detail::GetFormatType<DowncastType<T>>::format;
OpenPOWER on IntegriCloud