emailQt/Email.hpp

31 lines
721 B
C++

#pragma once
#include <sstream>
#include <string>
#include <unordered_map>
#include <QListWidgetItem>
#include <QString>
class Email : public QListWidgetItem {
public:
explicit Email(const std::string &str, size_t uid);
Email(const Email &e);
~Email() = default;
void setString(const std::string &str);
[[nodiscard]] const std::string &title() const;
[[nodiscard]] const std::string &message() const;
[[nodiscard]] const std::string &raw() const;
bool operator<(const QListWidgetItem &other) const override;
void parseEmailBody(std::stringstream &ss, std::string &line);
private:
std::string titleS;
std::string messageS;
std::string rawMessageS;
size_t uid;
};