summaryrefslogtreecommitdiff
path: root/src/operator-append.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-append.cc
parent1a7c572099edf744d6bb67318cff215de3fcd897 (diff)
use some enum classes
move ParseResult to recursivedescent.h
Diffstat (limited to 'src/operator-append.cc')
-rw-r--r--src/operator-append.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/operator-append.cc b/src/operator-append.cc
index 9463723..0e856ba 100644
--- a/src/operator-append.cc
+++ b/src/operator-append.cc
@@ -31,13 +31,17 @@ const string AppendOperator::getName() const
return "APPEND";
}
-int AppendOperator::getState() const
+Session::State AppendOperator::getState() const
{
- return Session::AUTHENTICATED | Session::SELECTED;
+ return Session::State(Session::State::AUTHENTICATED | Session::State::SELECTED);
}
Operator::ProcessResult AppendOperator::process(Depot &depot, Request &command)
{
+ constexpr auto NO = ProcessResult::NO;
+ constexpr auto ABORT = ProcessResult::ABORT;
+ constexpr auto BAD = ProcessResult::BAD;
+
Session &session = Session::getInstance();
const string &srcmailbox = command.getMailbox();
@@ -242,15 +246,17 @@ Operator::ProcessResult AppendOperator::process(Depot &depot, Request &command)
true);
}
- return OK;
+ return ProcessResult::OK;
}
-Operator::ParseResult AppendOperator::parse(Request &c_in) const
+Parser::ParseResult AppendOperator::parse(Request &c_in)
{
+ constexpr auto ACCEPT = Parser::ParseResult::ACCEPT;
+
Session &session = Session::getInstance();
- Operator::ParseResult res;
+ Parser::ParseResult res;
- if (c_in.getUidMode()) return REJECT;
+ if (c_in.getUidMode()) return Parser::ParseResult::REJECT;
if ((res = expectSPACE()) != ACCEPT) {
session.setLastError("Expected SPACE after APPEND");