summaryrefslogtreecommitdiff
path: root/src/operator-create.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/operator-create.cc')
-rw-r--r--src/operator-create.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/operator-create.cc b/src/operator-create.cc
index 4269c7a..399e740 100644
--- a/src/operator-create.cc
+++ b/src/operator-create.cc
@@ -26,29 +26,30 @@ const std::string CreateOperator::getName() const
return "CREATE";
}
-int CreateOperator::getState() const
+Session::State CreateOperator::getState() const
{
- return Session::AUTHENTICATED | Session::SELECTED;
+ return Session::State(Session::AUTHENTICATED | Session::SELECTED);
}
Operator::ProcessResult CreateOperator::process(Depot &depot, Request &command)
{
if (depot.createMailbox(command.getMailbox())) {
- return OK;
+ return Operator::ProcessResult::OK;
} else {
Session &session = Session::getInstance();
session.setLastError(depot.getLastError());
- return NO;
+ return Operator::ProcessResult::NO;
}
}
-Operator::ParseResult CreateOperator::parse(Request &c_in) const
+Parser::ParseResult CreateOperator::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 CREATE");
return res;