Initial commit

This commit is contained in:
2017-04-28 18:45:26 +02:00
commit 37fe983738
23 changed files with 1319 additions and 0 deletions
+57
View File
@@ -0,0 +1,57 @@
#ifndef MESSAGE_H
#define MESSAGE_H
#include <string>
#include <vector>
#include "mimeImage.h"
#include "inputImage.h"
#include "util.h"
class message
{
public:
message(const std::string& address, const context& context, const std::string& message);
private:
class state
{
public:
enum type
{
header,
data,
mimeBoundary,
image
};
};
private:
void processMessage(const std::string& message);
state::type processHeaderLine(const std::string& line);
state::type processDataLine(const std::string& line);
state::type processMimeBoundary(const std::string& line);
state::type processImage(const std::string& line);
private:
std::string m_address;
const context& m_context;
std::string m_sender;
std::string m_receiver;
std::string m_subject;
std::string m_date;
std::string m_mimeBoundary;
std::string m_contentType;
std::string m_contentEncoding;
size_t m_currentImage;
std::string m_imageName;
std::vector<mimeImage> m_mimeImages;
std::vector<inputImage> m_images;
};
#endif // MESSAGE_H