Bincimap 2.0.16
Easy Imapping
Loading...
Searching...
No Matches
operator-close.cc
Go to the documentation of this file.
1
7#include <string>
8
9#include "depot.h"
10#include "mailbox.h"
11#include "operators.h"
12#include "recursivedescent.h"
13#include "session.h"
14
15using namespace ::std;
16using namespace Binc;
17
18//----------------------------------------------------------------------
20{
21}
22
23//----------------------------------------------------------------------
25{
26}
27
28//------------------------------------------------------------------------
29const string CloseOperator::getName(void) const
30{
31 return "CLOSE";
32}
33
34//------------------------------------------------------------------------
36{
37 return Session::SELECTED;
38}
39
40//------------------------------------------------------------------------
42 Request &command)
43{
44 Mailbox *mailbox = depot.getSelected();
45 mailbox->expungeMailbox();
46 mailbox->closeMailbox();
47 depot.resetSelected();
48
49 Session &session = Session::getInstance();
51
52 return OK;
53}
54
55//----------------------------------------------------------------------
57{
58 Session &session = Session::getInstance();
59
60 if (c_in.getUidMode())
61 return REJECT;
62
64 if ((res = expectCRLF()) != ACCEPT) {
65 session.setLastError("Expected CRLF after CLOSE");
66 return res;
67 }
68
69 c_in.setName("CLOSE");
70 return ACCEPT;
71}
virtual ParseResult parse(Request &) const
int getState(void) const
ProcessResult process(Depot &, Request &)
const std::string getName(void) const
void resetSelected(void)
Definition: depot.cc:189
virtual Mailbox * getSelected(void) const
Definition: depot.cc:183
virtual void closeMailbox(void)=0
virtual void expungeMailbox(void)=0
void setName(const std::string &s_in)
Definition: imapparser.cc:70
bool getUidMode(void) const
Definition: imapparser.cc:40
void setLastError(const std::string &error) const
Definition: session.cc:185
void setState(int n)
Definition: session.cc:46
@ AUTHENTICATED
Definition: session.h:37
static Session & getInstance(void)
Definition: session.cc:33
Declaration of the Mailbox class (Mailbox is logical container)
Definition: bincimapd.cc:9
Operator::ParseResult expectCRLF(void)
Declaration of all operators.
Declaration of a recursive descent IMAP command parser.