summaryrefslogtreecommitdiff
path: root/src/operator-logout.cc
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2023-10-11 19:28:50 +0200
committerJannis M. Hoffmann <jannis@fehcom.de>2023-10-11 19:28:50 +0200
commit3ea7edf8c9bf7583c426178d4aaff4fb5b736bd2 (patch)
treeae78ebf9e9d1f70da8a6fdad1504063644ee8f1e /src/operator-logout.cc
parent1a7c572099edf744d6bb67318cff215de3fcd897 (diff)
use some enum classes
move ParseResult to recursivedescent.h
Diffstat (limited to 'src/operator-logout.cc')
-rw-r--r--src/operator-logout.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/operator-logout.cc b/src/operator-logout.cc
index af40b72..d58972b 100644
--- a/src/operator-logout.cc
+++ b/src/operator-logout.cc
@@ -28,9 +28,10 @@ const std::string LogoutOperator::getName() const
return "LOGOUT";
}
-int LogoutOperator::getState() const
+Session::State LogoutOperator::getState() const
{
- return Session::NONAUTHENTICATED | Session::AUTHENTICATED | Session::SELECTED;
+ return Session::State(Session::NONAUTHENTICATED | Session::AUTHENTICATED
+ | Session::SELECTED);
}
Operator::ProcessResult LogoutOperator::process(Depot &depot, Request &command)
@@ -50,21 +51,21 @@ Operator::ProcessResult LogoutOperator::process(Depot &depot, Request &command)
Session &session = Session::getInstance();
session.setState(Session::LOGOUT);
- return NOTHING;
+ return Operator::ProcessResult::NOTHING;
}
-Operator::ParseResult LogoutOperator::parse(Request &c_in) const
+Parser::ParseResult LogoutOperator::parse(Request &c_in)
{
Session &session = Session::getInstance();
- if (c_in.getUidMode()) return REJECT;
+ if (c_in.getUidMode()) return Parser::ParseResult::REJECT;
- Operator::ParseResult res;
- if ((res = expectCRLF()) != ACCEPT) {
+ Parser::ParseResult res;
+ if ((res = expectCRLF()) != Parser::ParseResult::ACCEPT) {
session.setLastError("Expected CRLF");
return res;
}
c_in.setName("LOGOUT");
- return ACCEPT;
+ return Parser::ParseResult::ACCEPT;
}