Bincimap 2.0.16
Easy Imapping
Loading...
Searching...
No Matches
operator-expunge.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 "imapparser.h"
13#include "recursivedescent.h"
14#include "pendingupdates.h"
15#include "session.h"
16
17using namespace ::std;
18using namespace Binc;
19
20//----------------------------------------------------------------------
22{
23}
24
25//----------------------------------------------------------------------
27{
28}
29
30//----------------------------------------------------------------------
31const string ExpungeOperator::getName(void) const
32{
33 return "EXPUNGE";
34}
35
36//----------------------------------------------------------------------
38{
39 return Session::SELECTED;
40}
41
42//----------------------------------------------------------------------
44 Request &command)
45{
46 Mailbox *mailbox = depot.getSelected();
47 mailbox->expungeMailbox();
48
52 | PendingUpdates::FLAGS, true);
53
54 return OK;
55}
56
57//----------------------------------------------------------------------
59{
60 Session &session = Session::getInstance();
61
62 if (c_in.getUidMode())
63 return REJECT;
64
66 if ((res = expectCRLF()) != ACCEPT) {
67 session.setLastError("Expected CRLF");
68 return res;
69 }
70
71 c_in.setName("EXPUNGE");
72 return ACCEPT;
73}
virtual Mailbox * getSelected(void) const
Definition: depot.cc:183
virtual ParseResult parse(Request &) const
int getState(void) const
ProcessResult process(Depot &, Request &)
const std::string getName(void) const
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
static Session & getInstance(void)
Definition: session.cc:33
Declaration of the common items for parsing IMAP input.
Declaration of the Mailbox class (Mailbox is logical container)
Definition: bincimapd.cc:9
bool pendingUpdates(Mailbox *, int type, bool rescan, bool showAll=false, bool forceScan=false, bool uidfetchflags=false)
Operator::ParseResult expectCRLF(void)
Declaration of all operators.
Declaration of a recursive descent IMAP command parser.