summaryrefslogtreecommitdiff
path: root/src/file/mail/checker_decorator.hpp
diff options
context:
space:
mode:
authorclaiff <claiff@mail.ru>2022-10-05 16:03:08 +0300
committerclaiff <claiff@mail.ru>2022-10-05 16:03:08 +0300
commit8edef99a5b52643e0b919c424357752cbbc9a8dd (patch)
treec7ae9c113d29aa3350eca04f27a933bd3b5f769c /src/file/mail/checker_decorator.hpp
parent2b03fece7f5895591eabd2f04baa2df19b4c3417 (diff)
parent3f1f70a3b945605c6abb7d23f46042b963db243a (diff)
downloadobmc-sila-smtp-8edef99a5b52643e0b919c424357752cbbc9a8dd.tar.xz
Merge branch 'refactor/3009'
Diffstat (limited to 'src/file/mail/checker_decorator.hpp')
-rw-r--r--src/file/mail/checker_decorator.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/file/mail/checker_decorator.hpp b/src/file/mail/checker_decorator.hpp
new file mode 100644
index 0000000..ed87fc5
--- /dev/null
+++ b/src/file/mail/checker_decorator.hpp
@@ -0,0 +1,25 @@
+#pragma once
+
+#include "management/general.hpp"
+#include "checker/registrator_mails.hpp"
+#include "message/builder/types/idecorator.hpp"
+#include "types/ifile_manipulator.hpp"
+
+namespace smtp::file::mail
+{
+ class CheckerDecorator : public smtp::message::builder::types::IDecorator< types::IFileManipulator>
+ {
+ public:
+ explicit CheckerDecorator( checker::RegistratorMails const& registrator_errors );
+ ~CheckerDecorator() override = default;
+
+ manage::MailsSet Read() const override;
+ bool Write( manage::MailsSet const& data ) const override;
+ private:
+ manage::MailsSet ReadFile( std::ifstream& mail_file ) const;
+ bool WriteFile( std::ofstream& mail_file, manage::MailsSet const& data ) const;
+
+ checker::RegistratorMails mRegistratorErrors;
+ };
+
+}