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-capability.cc | |
parent | 1a7c572099edf744d6bb67318cff215de3fcd897 (diff) |
use some enum classes
move ParseResult to recursivedescent.h
Diffstat (limited to 'src/operator-capability.cc')
-rw-r--r-- | src/operator-capability.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/operator-capability.cc b/src/operator-capability.cc index eff7e5a..33d787a 100644 --- a/src/operator-capability.cc +++ b/src/operator-capability.cc @@ -27,9 +27,10 @@ const string CapabilityOperator::getName() const return "CAPABILITY"; } -int CapabilityOperator::getState() const +Session::State CapabilityOperator::getState() const { - return Session::NONAUTHENTICATED | Session::AUTHENTICATED | Session::SELECTED; + return Session::State(Session::NONAUTHENTICATED | Session::AUTHENTICATED + | Session::SELECTED); } void CapabilityOperator::addCapability(const string &cap) @@ -69,22 +70,22 @@ Operator::ProcessResult CapabilityOperator::process(Depot &depot, Request &comma } bincClient << std::endl; - return OK; + return Operator::ProcessResult::OK; } -Operator::ParseResult CapabilityOperator::parse(Request &c_in) const +Parser::ParseResult CapabilityOperator::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 CAPABILITY"); return res; } c_in.setName("CAPABILITY"); - return ACCEPT; + return Parser::ParseResult::ACCEPT; } |