Move to new Build System

This commit is contained in:
2020-05-01 10:21:46 +02:00
parent 4ee3f56bd7
commit 1a464d85cf
51 changed files with 1088 additions and 1101 deletions
+66
View File
@@ -0,0 +1,66 @@
#ifndef PROTOCOL_H
#define PROTOCOL_H
#include "Util/Util.h"
#include <string>
#include <utility>
namespace Protocol {
class Protocol
{
public:
class State
{
public:
enum type
{
Connected,
Disconnected
};
};
typedef std::pair<State::type, std::string> Result;
public:
explicit Protocol(const Util::Context& context);
Result OpenConnection(const std::string& address);
Result ProcessMessage(const std::string& message);
private:
class InternalState
{
public:
enum type
{
None,
Connect,
Helo,
Auth_login_user,
Auth_login_pass,
Mail_from,
Rcpt_to,
Data,
Mime_boundary,
Image_data,
Disconnect
};
};
private:
Result Answer(State::type state, std::string answer) const;
void AppendMessage(const std::string& message);
private:
InternalState::type m_internalState;
std::string m_address;
std::string m_message;
const Util::Context& m_context;
};
} // namespace Protocol
#endif // PROTOCOL_H