diff options
author | Ed Tanous <ed@tanous.net> | 2020-09-29 00:29:23 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2020-09-29 21:38:42 +0300 |
commit | 2c70f8004afdc27bd42968b8bf7480f2e534974c (patch) | |
tree | 569f4cb0110aae2ccd0e4d197efe4c3a36c5b7b6 /redfish-core/include | |
parent | 3e4c7797033926a0502cdd4491421c8b16684aef (diff) | |
download | bmcweb-2c70f8004afdc27bd42968b8bf7480f2e534974c.tar.xz |
Fix naming conventions
Lots of code has been checked in that doesn't match the naming
conventions. Lets fix that.
Tested:
Code compiles. Variable/function renames only.
Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: I6bd107811d0b724f1fad990016113cdf035b604b
Diffstat (limited to 'redfish-core/include')
-rw-r--r-- | redfish-core/include/node.hpp | 6 | ||||
-rw-r--r-- | redfish-core/include/resource_messages.hpp | 6 | ||||
-rw-r--r-- | redfish-core/include/utils/json_utils.hpp | 35 |
3 files changed, 19 insertions, 28 deletions
diff --git a/redfish-core/include/node.hpp b/redfish-core/include/node.hpp index 797160db7f..9863794e62 100644 --- a/redfish-core/include/node.hpp +++ b/redfish-core/include/node.hpp @@ -91,9 +91,9 @@ class Node doPut(res, req, paramVec); }); - crow::DynamicRule& delete_ = app.routeDynamic(entityUrl.c_str()); - deleteRule = &delete_; - delete_.methods(boost::beast::http::verb::delete_)( + crow::DynamicRule& deleteR = app.routeDynamic(entityUrl.c_str()); + deleteRule = &deleteR; + deleteR.methods(boost::beast::http::verb::delete_)( [this](const crow::Request& req, crow::Response& res, Params... params) { std::vector<std::string> paramVec = {params...}; diff --git a/redfish-core/include/resource_messages.hpp b/redfish-core/include/resource_messages.hpp index 9826566e27..17157fe250 100644 --- a/redfish-core/include/resource_messages.hpp +++ b/redfish-core/include/resource_messages.hpp @@ -5,7 +5,7 @@ namespace redfish namespace messages { -inline nlohmann::json ResourceChanged(void) +inline nlohmann::json resourceChanged(void) { return nlohmann::json{ {"EventType", "ResourceChanged"}, @@ -16,7 +16,7 @@ inline nlohmann::json ResourceChanged(void) {"MessageSeverity", "OK"}}; } -inline nlohmann::json ResourceCreated(void) +inline nlohmann::json resourceCreated(void) { return nlohmann::json{ {"EventType", "ResourceAdded"}, @@ -27,7 +27,7 @@ inline nlohmann::json ResourceCreated(void) {"MessageSeverity", "OK"}}; } -inline nlohmann::json ResourceRemoved(void) +inline nlohmann::json resourceRemoved(void) { return nlohmann::json{ {"EventType", "ResourceRemoved"}, diff --git a/redfish-core/include/utils/json_utils.hpp b/redfish-core/include/utils/json_utils.hpp index c4f54d719c..7bd8bb874c 100644 --- a/redfish-core/include/utils/json_utils.hpp +++ b/redfish-core/include/utils/json_utils.hpp @@ -46,38 +46,29 @@ namespace details { template <typename Type> -struct is_optional : std::false_type +struct IsOptional : std::false_type {}; template <typename Type> -struct is_optional<std::optional<Type>> : std::true_type +struct IsOptional<std::optional<Type>> : std::true_type {}; template <typename Type> -constexpr bool is_optional_v = is_optional<Type>::value; - -template <typename Type> -struct is_vector : std::false_type +struct IsVector : std::false_type {}; template <typename Type> -struct is_vector<std::vector<Type>> : std::true_type +struct IsVector<std::vector<Type>> : std::true_type {}; template <typename Type> -constexpr bool is_vector_v = is_vector<Type>::value; - -template <typename Type> -struct is_std_array : std::false_type +struct IsStdArray : std::false_type {}; template <typename Type, std::size_t size> -struct is_std_array<std::array<Type, size>> : std::true_type +struct IsStdArray<std::array<Type, size>> : std::true_type {}; -template <typename Type> -constexpr bool is_std_array_v = is_std_array<Type>::value; - enum class UnpackErrorCode { success, @@ -206,14 +197,14 @@ bool unpackValue(nlohmann::json& jsonValue, const std::string& key, { bool ret = true; - if constexpr (is_optional_v<Type>) + if constexpr (IsOptional<Type>::value) { value.emplace(); ret = unpackValue<typename Type::value_type>(jsonValue, key, res, *value) && ret; } - else if constexpr (is_std_array_v<Type>) + else if constexpr (IsStdArray<Type>::value) { if (!jsonValue.is_array()) { @@ -233,7 +224,7 @@ bool unpackValue(nlohmann::json& jsonValue, const std::string& key, ret; } } - else if constexpr (is_vector_v<Type>) + else if constexpr (IsVector<Type>::value) { if (!jsonValue.is_array()) { @@ -273,13 +264,13 @@ template <typename Type> bool unpackValue(nlohmann::json& jsonValue, const std::string& key, Type& value) { bool ret = true; - if constexpr (is_optional_v<Type>) + if constexpr (IsOptional<Type>::value) { value.emplace(); ret = unpackValue<typename Type::value_type>(jsonValue, key, *value) && ret; } - else if constexpr (is_std_array_v<Type>) + else if constexpr (IsStdArray<Type>::value) { if (!jsonValue.is_array()) { @@ -297,7 +288,7 @@ bool unpackValue(nlohmann::json& jsonValue, const std::string& key, Type& value) ret; } } - else if constexpr (is_vector_v<Type>) + else if constexpr (IsVector<Type>::value) { if (!jsonValue.is_array()) { @@ -366,7 +357,7 @@ bool handleMissing(std::bitset<Count>& handled, crow::Response& res, const char* key, ValueType&, UnpackTypes&... in) { bool ret = true; - if (!handled.test(Index) && !is_optional_v<ValueType>) + if (!handled.test(Index) && !IsOptional<ValueType>::value) { ret = false; messages::propertyMissing(res, key); |