diff options
author | claiff <claiff@mail.ru> | 2022-10-05 15:57:43 +0300 |
---|---|---|
committer | claiff <claiff@mail.ru> | 2022-10-05 15:57:43 +0300 |
commit | 43e721305c866ad4b2c4c35d1133f169e41dd49b (patch) | |
tree | c7ae9c113d29aa3350eca04f27a933bd3b5f769c /src/file/mail/checker_decorator.hpp | |
parent | 9ed43c1057eeec6a01b8fdfd4d2ee54f9df39670 (diff) | |
download | obmc-sila-smtp-43e721305c866ad4b2c4c35d1133f169e41dd49b.tar.xz |
file reader/writer split by decorators
Diffstat (limited to 'src/file/mail/checker_decorator.hpp')
-rw-r--r-- | src/file/mail/checker_decorator.hpp | 25 |
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; + }; + +} |