mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-07-22 14:04:24 -04:00
52 lines
1.2 KiB
C++
52 lines
1.2 KiB
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include "BaseHelper.hpp"
|
|
#include <Context.hpp>
|
|
|
|
namespace parserFSM
|
|
{
|
|
|
|
auto ret() -> BaseHelper::ProcessResult
|
|
{
|
|
return {sent::no, std::nullopt};
|
|
}
|
|
|
|
auto BaseHelper::processPut(Context &) -> ProcessResult
|
|
{
|
|
return ret();
|
|
}
|
|
|
|
auto BaseHelper::processGet(Context &) -> ProcessResult
|
|
{
|
|
return ret();
|
|
}
|
|
|
|
auto BaseHelper::processPost(Context &) -> ProcessResult
|
|
{
|
|
return ret();
|
|
}
|
|
|
|
auto BaseHelper::processDelete(Context &) -> ProcessResult
|
|
{
|
|
return ret();
|
|
}
|
|
|
|
[[nodiscard]] auto BaseHelper::process(http::Method method, Context &context) -> ProcessResult
|
|
{
|
|
preProcess(method, context);
|
|
switch (method) {
|
|
case http::Method::del:
|
|
return processDelete(context);
|
|
case http::Method::get:
|
|
return processGet(context);
|
|
case http::Method::post:
|
|
return processPost(context);
|
|
case http::Method::put:
|
|
return processPut(context);
|
|
}
|
|
postProcess(method, context);
|
|
return {sent::no, std::nullopt};
|
|
}
|
|
} // namespace parserFSM
|