diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-10-11 19:28:50 +0200 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-10-11 19:28:50 +0200 |
commit | 3ea7edf8c9bf7583c426178d4aaff4fb5b736bd2 (patch) | |
tree | ae78ebf9e9d1f70da8a6fdad1504063644ee8f1e /src/operator-noop.cc | |
parent | 1a7c572099edf744d6bb67318cff215de3fcd897 (diff) |
use some enum classes
move ParseResult to recursivedescent.h
Diffstat (limited to 'src/operator-noop.cc')
-rw-r--r-- | src/operator-noop.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/operator-noop.cc b/src/operator-noop.cc index 77d2d9d..9d72e8f 100644 --- a/src/operator-noop.cc +++ b/src/operator-noop.cc @@ -24,29 +24,30 @@ const std::string NoopOperator::getName() const return "NOOP"; } -int NoopOperator::getState() const +Session::State NoopOperator::getState() const { - return Session::NONAUTHENTICATED | Session::AUTHENTICATED | Session::SELECTED; + return Session::State(Session::NONAUTHENTICATED | Session::AUTHENTICATED + | Session::SELECTED); } Operator::ProcessResult NoopOperator::process(Depot &depot, Request &command) { - return OK; + return Operator::ProcessResult::OK; } -Operator::ParseResult NoopOperator::parse(Request &c_in) const +Parser::ParseResult NoopOperator::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 after NOOP"); return res; } c_in.setName("NOOP"); - return ACCEPT; + return Parser::ParseResult::ACCEPT; } |