BARANTMail/BMAIMAPSession.h
2019-07-10 20:13:12 -07:00

35 lines
794 B
C++

#ifndef __BMAIMAPSession_h__
#define __BMAIMAPSession_h__
#include "BMASession.h"
#include "BMAIMAPServer.h"
///
/// BMAIMAPSession
///
/// Extends the session parameters for this BMATCPSocket derived object.
/// Extend the protocol() method in order to define the behavior and
/// protocol interaction for this socket which is an IMAP session.
///
class BMAIMAPSession : public BMASession {
public:
BMAIMAPSession(BMAEPoll &ePoll, BMAConsoleServer &server);
~BMAIMAPSession();
virtual void output(std::stringstream &out);
protected:
void protocol(char *data, int length) override;
private:
BMAConsoleServer &server;
enum Status {WELCOME, PROMPT, INPUT, PROCESS, DONE};
Status status = WELCOME;
void doCommand(std::string request);
};
#endif