From 3ea7edf8c9bf7583c426178d4aaff4fb5b736bd2 Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Wed, 11 Oct 2023 19:28:50 +0200 Subject: use some enum classes move ParseResult to recursivedescent.h --- src/operator-noop.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/operator-noop.cc') 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; } -- cgit v1.2.3