From 1633268d57f7b0713bc6564af725c3a8506f8eb1 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Thu, 30 May 2019 14:39:15 +0900 Subject: [PATCH] refactor: use snake_case typename only --- toml/get.hpp | 2 +- toml/types.hpp | 40 ++++++++++++++++----------------- toml/value.hpp | 60 +++++++++++++++++++++++++------------------------- 3 files changed, 51 insertions(+), 51 deletions(-) diff --git a/toml/get.hpp b/toml/get.hpp index c326846..cf2cec4 100644 --- a/toml/get.hpp +++ b/toml/get.hpp @@ -276,7 +276,7 @@ namespace detail { template -T get_tuple_impl(const toml::Array& a, index_sequence) +T get_tuple_impl(const toml::array& a, index_sequence) { return std::make_tuple( ::toml::get::type>(a.at(I))...); diff --git a/toml/types.hpp b/toml/types.hpp index b879176..a221d84 100644 --- a/toml/types.hpp +++ b/toml/types.hpp @@ -131,30 +131,30 @@ template<> struct toml_default_type {typedef table template<> struct toml_default_type {typedef void type;}; template<> struct toml_default_type {typedef void type;}; -template struct toml_value_t {static constexpr value_t value = value_t::Unknown ;}; -template<> struct toml_value_t{static constexpr value_t value = value_t::Boolean ;}; -template<> struct toml_value_t{static constexpr value_t value = value_t::Integer ;}; -template<> struct toml_value_t{static constexpr value_t value = value_t::Float ;}; -template<> struct toml_value_t{static constexpr value_t value = value_t::String ;}; -template<> struct toml_value_t{static constexpr value_t value = value_t::OffsetDatetime;}; -template<> struct toml_value_t{static constexpr value_t value = value_t::LocalDatetime ;}; -template<> struct toml_value_t{static constexpr value_t value = value_t::LocalDate ;}; -template<> struct toml_value_t{static constexpr value_t value = value_t::LocalTime ;}; -template<> struct toml_value_t{static constexpr value_t value = value_t::Array ;}; -template<> struct toml_value_t{static constexpr value_t value = value_t::Table ;}; +template struct toml_value_t {static constexpr value_t value = value_t::Unknown ;}; +template<> struct toml_value_t{static constexpr value_t value = value_t::Boolean ;}; +template<> struct toml_value_t{static constexpr value_t value = value_t::Integer ;}; +template<> struct toml_value_t{static constexpr value_t value = value_t::Float ;}; +template<> struct toml_value_t{static constexpr value_t value = value_t::String ;}; +template<> struct toml_value_t{static constexpr value_t value = value_t::OffsetDatetime;}; +template<> struct toml_value_t{static constexpr value_t value = value_t::LocalDatetime ;}; +template<> struct toml_value_t{static constexpr value_t value = value_t::LocalDate ;}; +template<> struct toml_value_t{static constexpr value_t value = value_t::LocalTime ;}; +template<> struct toml_value_t{static constexpr value_t value = value_t::Array ;}; +template<> struct toml_value_t
{static constexpr value_t value = value_t::Table ;}; template struct is_exact_toml_type : disjunction< - std::is_same, - std::is_same, - std::is_same, - std::is_same, + std::is_same, + std::is_same, + std::is_same, + std::is_same, std::is_same, - std::is_same, - std::is_same, - std::is_same, - std::is_same, - std::is_same + std::is_same, + std::is_same, + std::is_same, + std::is_same, + std::is_same >{}; template struct is_exact_toml_type : is_exact_toml_type{}; template struct is_exact_toml_type : is_exact_toml_type{}; diff --git a/toml/value.hpp b/toml/value.hpp index 7f6f42b..e42e6f5 100644 --- a/toml/value.hpp +++ b/toml/value.hpp @@ -759,72 +759,72 @@ struct switch_cast; template<> struct switch_cast { - static Boolean& invoke(value& v) {return v.as_boolean();} - static Boolean const& invoke(value const& v) {return v.as_boolean();} - static Boolean&& invoke(value&& v) {return std::move(v).as_boolean();} + static ::toml::boolean& invoke(value& v) {return v.as_boolean();} + static ::toml::boolean const& invoke(value const& v) {return v.as_boolean();} + static ::toml::boolean&& invoke(value&& v) {return std::move(v).as_boolean();} }; template<> struct switch_cast { - static Integer& invoke(value& v) {return v.as_integer();} - static Integer const& invoke(value const& v) {return v.as_integer();} - static Integer&& invoke(value&& v) {return std::move(v).as_integer();} + static ::toml::integer& invoke(value& v) {return v.as_integer();} + static ::toml::integer const& invoke(value const& v) {return v.as_integer();} + static ::toml::integer&& invoke(value&& v) {return std::move(v).as_integer();} }; template<> struct switch_cast { - static Float& invoke(value& v) {return v.as_float();} - static Float const& invoke(value const& v) {return v.as_float();} - static Float&& invoke(value&& v) {return std::move(v).as_float();} + static ::toml::floating& invoke(value& v) {return v.as_float();} + static ::toml::floating const& invoke(value const& v) {return v.as_float();} + static ::toml::floating&& invoke(value&& v) {return std::move(v).as_float();} }; template<> struct switch_cast { - static String& invoke(value& v) {return v.as_string();} - static String const& invoke(value const& v) {return v.as_string();} - static String&& invoke(value&& v) {return std::move(v).as_string();} + static ::toml::string& invoke(value& v) {return v.as_string();} + static ::toml::string const& invoke(value const& v) {return v.as_string();} + static ::toml::string&& invoke(value&& v) {return std::move(v).as_string();} }; template<> struct switch_cast { - static OffsetDatetime& invoke(value& v) {return v.as_offset_datetime();} - static OffsetDatetime const& invoke(value const& v) {return v.as_offset_datetime();} - static OffsetDatetime&& invoke(value&& v) {return std::move(v).as_offset_datetime();} + static ::toml::offset_datetime& invoke(value& v) {return v.as_offset_datetime();} + static ::toml::offset_datetime const& invoke(value const& v) {return v.as_offset_datetime();} + static ::toml::offset_datetime&& invoke(value&& v) {return std::move(v).as_offset_datetime();} }; template<> struct switch_cast { - static LocalDatetime& invoke(value& v) {return v.as_local_datetime();} - static LocalDatetime const& invoke(value const& v) {return v.as_local_datetime();} - static LocalDatetime&& invoke(value&& v) {return std::move(v).as_local_datetime();} + static ::toml::local_datetime& invoke(value& v) {return v.as_local_datetime();} + static ::toml::local_datetime const& invoke(value const& v) {return v.as_local_datetime();} + static ::toml::local_datetime&& invoke(value&& v) {return std::move(v).as_local_datetime();} }; template<> struct switch_cast { - static LocalDate& invoke(value& v) {return v.as_local_date();} - static LocalDate const& invoke(value const& v) {return v.as_local_date();} - static LocalDate&& invoke(value&& v) {return std::move(v).as_local_date();} + static ::toml::local_date& invoke(value& v) {return v.as_local_date();} + static ::toml::local_date const& invoke(value const& v) {return v.as_local_date();} + static ::toml::local_date&& invoke(value&& v) {return std::move(v).as_local_date();} }; template<> struct switch_cast { - static LocalTime& invoke(value& v) {return v.as_local_time();} - static LocalTime const& invoke(value const& v) {return v.as_local_time();} - static LocalTime&& invoke(value&& v) {return std::move(v).as_local_time();} + static ::toml::local_time& invoke(value& v) {return v.as_local_time();} + static ::toml::local_time const& invoke(value const& v) {return v.as_local_time();} + static ::toml::local_time&& invoke(value&& v) {return std::move(v).as_local_time();} }; template<> struct switch_cast { - static Array& invoke(value& v) {return v.as_array();} - static Array const& invoke(value const& v) {return v.as_array();} - static Array&& invoke(value&& v) {return std::move(v).as_array();} + static ::toml::array& invoke(value& v) {return v.as_array();} + static ::toml::array const& invoke(value const& v) {return v.as_array();} + static ::toml::array&& invoke(value&& v) {return std::move(v).as_array();} }; template<> struct switch_cast { - static Table& invoke(value& v) {return v.as_table();} - static Table const& invoke(value const& v) {return v.as_table();} - static Table&& invoke(value&& v) {return std::move(v).as_table();} + static ::toml::table& invoke(value& v) {return v.as_table();} + static ::toml::table const& invoke(value const& v) {return v.as_table();} + static ::toml::table&& invoke(value&& v) {return std::move(v).as_table();} }; }// detail