Bincimap 2.0.16
Easy Imapping
Loading...
Searching...
No Matches
operator-id.cc
Go to the documentation of this file.
1
7#include <string>
8#include <iostream>
9
10#include "depot.h"
11#include "iodevice.h"
12#include "iofactory.h"
13#include "operators.h"
14#include "recursivedescent.h"
15#include "session.h"
16#include "globals.h"
17
18using namespace ::std;
19using namespace Binc;
20
21//----------------------------------------------------------------------
23{
24}
25
26//----------------------------------------------------------------------
28{
29}
30
31//----------------------------------------------------------------------
32const string IdOperator::getName(void) const
33{
34 return "ID";
35}
36
37//----------------------------------------------------------------------
38int IdOperator::getState(void) const
39{
43}
44
45//----------------------------------------------------------------------
47 Request &command)
48{
49 bincClient << "* ID (\"name\" \"Binc IMAP\""
50 << " \"version\" \"" << BINC_VERSION "\")" << endl;
51
52 return OK;
53}
54
55//----------------------------------------------------------------------
57{
58 Session &session = Session::getInstance();
59
60 if (c_in.getUidMode()) return REJECT;
61
63 if ((res = expectSPACE()) != ACCEPT && (res = expectCRLF()) != ACCEPT) {
64 session.setLastError("Expected SPACE or CRLF");
65 return res;
66 }
67
68 c_in.setName("ID");
69
70 return ACCEPT;
71}
virtual ParseResult parse(Request &) const
Definition: operator-id.cc:56
int getState(void) const
Definition: operator-id.cc:38
ProcessResult process(Depot &, Request &)
Definition: operator-id.cc:46
const std::string getName(void) const
Definition: operator-id.cc:32
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
@ NONAUTHENTICATED
Definition: session.h:36
@ AUTHENTICATED
Definition: session.h:37
static Session & getInstance(void)
Definition: session.cc:33
Global constants.
#define BINC_VERSION
Definition: globals.h:10
Declaration of the IODevice class.
Declaration of the IOFactory class.
#define bincClient
Definition: iofactory.h:31
Definition: bincimapd.cc:9
Operator::ParseResult expectSPACE(void)
Operator::ParseResult expectCRLF(void)
Declaration of all operators.
Declaration of a recursive descent IMAP command parser.