summaryrefslogtreecommitdiff
path: root/http/routing.hpp
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2023-05-10 15:51:34 +0300
committerPatrick Williams <patrick@stwcx.xyz>2023-05-11 00:18:24 +0300
commit89492a157c9cf972b342421e24d41fd382510251 (patch)
tree64ed25f427f1ab1981f8c2bdcbfbc7fde5db80e9 /http/routing.hpp
parentcddbf3df0ea0b78521b62f30f2ce764c6619018a (diff)
downloadbmcweb-89492a157c9cf972b342421e24d41fd382510251.tar.xz
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest .clang-format from the docs repository and reformat the repository. Change-Id: I75f89d2959b0f1338c20d72ad669fbdc1d720835 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'http/routing.hpp')
-rw-r--r--http/routing.hpp33
1 files changed, 12 insertions, 21 deletions
diff --git a/http/routing.hpp b/http/routing.hpp
index 18d3c2afd9..5bf6902e9c 100644
--- a/http/routing.hpp
+++ b/http/routing.hpp
@@ -34,8 +34,7 @@ namespace crow
class BaseRule
{
public:
- explicit BaseRule(const std::string& thisRule) : rule(thisRule)
- {}
+ explicit BaseRule(const std::string& thisRule) : rule(thisRule) {}
virtual ~BaseRule() = default;
@@ -183,8 +182,7 @@ struct Wrapped
template <typename Req, typename... Args>
struct ReqHandlerWrapper
{
- explicit ReqHandlerWrapper(Func fIn) : f(std::move(fIn))
- {}
+ explicit ReqHandlerWrapper(Func fIn) : f(std::move(fIn)) {}
void operator()(const Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -284,11 +282,9 @@ class WebSocketRule : public BaseRule
using self_t = WebSocketRule;
public:
- explicit WebSocketRule(const std::string& ruleIn) : BaseRule(ruleIn)
- {}
+ explicit WebSocketRule(const std::string& ruleIn) : BaseRule(ruleIn) {}
- void validate() override
- {}
+ void validate() override {}
void handle(const Request& /*req*/,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -453,8 +449,7 @@ struct RuleParameterTraits
class DynamicRule : public BaseRule, public RuleParameterTraits<DynamicRule>
{
public:
- explicit DynamicRule(const std::string& ruleIn) : BaseRule(ruleIn)
- {}
+ explicit DynamicRule(const std::string& ruleIn) : BaseRule(ruleIn) {}
void validate() override
{
@@ -514,8 +509,7 @@ class TaggedRule :
public:
using self_t = TaggedRule<Args...>;
- explicit TaggedRule(const std::string& ruleIn) : BaseRule(ruleIn)
- {}
+ explicit TaggedRule(const std::string& ruleIn) : BaseRule(ruleIn) {}
void validate() override
{
@@ -584,8 +578,7 @@ class Trie
}
};
- Trie() : nodes(1)
- {}
+ Trie() : nodes(1) {}
private:
void optimizeNode(Node* node)
@@ -1015,8 +1008,8 @@ class Router
// Make sure it's safe to deference the array at that index
static_assert(maxVerbIndex <
std::tuple_size_v<decltype(perMethods)>);
- FindRoute route =
- findRouteByIndex(req.url().encoded_path(), perMethodIndex);
+ FindRoute route = findRouteByIndex(req.url().encoded_path(),
+ perMethodIndex);
if (route.rule == nullptr)
{
continue;
@@ -1246,8 +1239,8 @@ class Router
// route
if (foundRoute.allowHeader.empty())
{
- foundRoute.route =
- findRouteByIndex(req.url().encoded_path(), notFoundIndex);
+ foundRoute.route = findRouteByIndex(req.url().encoded_path(),
+ notFoundIndex);
}
else
{
@@ -1260,7 +1253,6 @@ class Router
// Fill in the allow header if it's valid
if (!foundRoute.allowHeader.empty())
{
-
asyncResp->res.addHeader(boost::beast::http::field::allow,
foundRoute.allowHeader);
}
@@ -1332,8 +1324,7 @@ class Router
Trie trie;
// rule index 0 has special meaning; preallocate it to avoid
// duplication.
- PerMethod() : rules(1)
- {}
+ PerMethod() : rules(1) {}
};
std::array<PerMethod, methodNotAllowedIndex + 1> perMethods;