summaryrefslogtreecommitdiff
path: root/src/operator-list.cc
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2023-10-11 19:28:50 +0200
committerJannis M. Hoffmann <jannis@fehcom.de>2023-10-11 19:28:50 +0200
commit3ea7edf8c9bf7583c426178d4aaff4fb5b736bd2 (patch)
treeae78ebf9e9d1f70da8a6fdad1504063644ee8f1e /src/operator-list.cc
parent1a7c572099edf744d6bb67318cff215de3fcd897 (diff)
use some enum classes
move ParseResult to recursivedescent.h
Diffstat (limited to 'src/operator-list.cc')
-rw-r--r--src/operator-list.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/operator-list.cc b/src/operator-list.cc
index 25934fa..519eb79 100644
--- a/src/operator-list.cc
+++ b/src/operator-list.cc
@@ -39,9 +39,9 @@ const string ListOperator::getName() const
return "LIST";
}
-int ListOperator::getState() const
+Session::State ListOperator::getState() const
{
- return Session::AUTHENTICATED | Session::SELECTED;
+ return Session::State(Session::AUTHENTICATED | Session::SELECTED);
}
Operator::ProcessResult ListOperator::process(Depot &depot, Request &command)
@@ -54,7 +54,7 @@ Operator::ProcessResult ListOperator::process(Depot &depot, Request &command)
string wildcard;
if ((wildcard = command.getListMailbox()) == "") {
bincClient << "* LIST (\\Noselect) \"" << delim << "\" \"\"" << std::endl;
- return OK;
+ return Operator::ProcessResult::OK;
}
// remove leading or trailing delimiter in wildcard
@@ -196,16 +196,18 @@ Operator::ProcessResult ListOperator::process(Depot &depot, Request &command)
}
}
- return OK;
+ return Operator::ProcessResult::OK;
}
-Operator::ParseResult ListOperator::parse(Request &c_in) const
+Parser::ParseResult ListOperator::parse(Request &c_in)
{
+ constexpr auto ACCEPT = Parser::ParseResult::ACCEPT;
+
Session &session = Session::getInstance();
- if (c_in.getUidMode()) return REJECT;
+ if (c_in.getUidMode()) return Parser::ParseResult::REJECT;
- Operator::ParseResult res;
+ Parser::ParseResult res;
if ((res = expectSPACE()) != ACCEPT) {
session.setLastError("Expected SPACE after LIST");
return res;