diff options
Diffstat (limited to 'src/operator-search.cc')
-rw-r--r-- | src/operator-search.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/operator-search.cc b/src/operator-search.cc index c013e70..1da4ee7 100644 --- a/src/operator-search.cc +++ b/src/operator-search.cc @@ -485,7 +485,7 @@ const string SearchOperator::getName() const return "SEARCH"; } -int SearchOperator::getState() const +Session::State SearchOperator::getState() const { return Session::SELECTED; } @@ -499,7 +499,7 @@ Operator::ProcessResult SearchOperator::process(Depot &depot, Request &command) if (command.getCharSet() != "" && command.getCharSet() != "US-ASCII") { session.setLastError("The " + command.getCharSet() + " charset is not supported"); session.setResponseCode("[BADCHARSET (\"US-ASCII\")]"); - return NO; + return Operator::ProcessResult::NO; } bincClient << "* SEARCH"; @@ -524,14 +524,16 @@ Operator::ProcessResult SearchOperator::process(Depot &depot, Request &command) } bincClient << endl; - return OK; + return Operator::ProcessResult::OK; } -Operator::ParseResult SearchOperator::parse(Request &c_in) const +Parser::ParseResult SearchOperator::parse(Request &c_in) { + constexpr auto ACCEPT = Parser::ParseResult::ACCEPT; + Session &session = Session::getInstance(); - Operator::ParseResult res; + Parser::ParseResult res; if ((res = expectSPACE()) != ACCEPT) { session.setLastError("Expected SPACE"); return res; @@ -587,10 +589,12 @@ Operator::ParseResult SearchOperator::parse(Request &c_in) const return ACCEPT; } -Operator::ParseResult SearchOperator::expectSearchKey(BincImapParserSearchKey &s_in) const +Parser::ParseResult SearchOperator::expectSearchKey(BincImapParserSearchKey &s_in) const { + constexpr auto ACCEPT = Parser::ParseResult::ACCEPT; + Session &session = Session::getInstance(); - Operator::ParseResult res; + Parser::ParseResult res; s_in.type = BincImapParserSearchKey::KEY_OTHER; if ((res = expectThisString("ALL")) == ACCEPT) { @@ -913,7 +917,7 @@ Operator::ParseResult SearchOperator::expectSearchKey(BincImapParserSearchKey &s return res; } } else { - return REJECT; + return Parser::ParseResult::REJECT; } return ACCEPT; |