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-namespace.cc | |
parent | 1a7c572099edf744d6bb67318cff215de3fcd897 (diff) |
use some enum classes
move ParseResult to recursivedescent.h
Diffstat (limited to 'src/operator-namespace.cc')
-rw-r--r-- | src/operator-namespace.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/operator-namespace.cc b/src/operator-namespace.cc index a331420..6bf80f4 100644 --- a/src/operator-namespace.cc +++ b/src/operator-namespace.cc @@ -26,9 +26,9 @@ const std::string NamespaceOperator::getName() const return "NAMESPACE"; } -int NamespaceOperator::getState() const +Session::State NamespaceOperator::getState() const { - return Session::AUTHENTICATED | Session::SELECTED; + return Session::State(Session::AUTHENTICATED | Session::SELECTED); } Operator::ProcessResult NamespaceOperator::process(Depot &depot, Request &command) @@ -46,22 +46,22 @@ Operator::ProcessResult NamespaceOperator::process(Depot &depot, Request &comman bincClient << " NIL"; // shared namespaces bincClient << std::endl; - return OK; + return Operator::ProcessResult::OK; } -Operator::ParseResult NamespaceOperator::parse(Request &c_in) const +Parser::ParseResult NamespaceOperator::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 NAMESPACE"); return res; } c_in.setName("NAMESPACE"); - return ACCEPT; + return Parser::ParseResult::ACCEPT; } |