diff options
Diffstat (limited to 'src/management/builder')
-rw-r--r-- | src/management/builder/mail.cpp | 23 | ||||
-rw-r--r-- | src/management/builder/mail.hpp | 18 | ||||
-rw-r--r-- | src/management/builder/settings.cpp | 29 | ||||
-rw-r--r-- | src/management/builder/settings.hpp | 21 |
4 files changed, 91 insertions, 0 deletions
diff --git a/src/management/builder/mail.cpp b/src/management/builder/mail.cpp new file mode 100644 index 0000000..f72803f --- /dev/null +++ b/src/management/builder/mail.cpp @@ -0,0 +1,23 @@ +#include "mail.hpp" +#include "file/mail.hpp" + +namespace smtp::manage::builder +{ + smtp::manage::Mail Mail::Build() const + { + static const std::string PATH = {"/var/lib/smtp/mails.txt"}; + + auto registrator = BuildErrorRegistrator(); + file::Mail file_manipulator{PATH, registrator}; + return smtp::manage::Mail{file_manipulator}; + } + + checker::RegistratorMails Mail::BuildErrorRegistrator() const + { + checker::RegistratorMails result; + + + return result; + } + +} diff --git a/src/management/builder/mail.hpp b/src/management/builder/mail.hpp new file mode 100644 index 0000000..ad1de36 --- /dev/null +++ b/src/management/builder/mail.hpp @@ -0,0 +1,18 @@ +#pragma once + +#include "managment/mail.hpp" +#include "checker/registrator_mails.hpp" + +namespace smtp::manage::builder +{ + class Mail + { + public: + Mail() = default; + ~Mail() = default; + + smtp::manage::Mail Build() const; + checker::RegistratorMails BuildErrorRegistrator() const; + }; + +} diff --git a/src/management/builder/settings.cpp b/src/management/builder/settings.cpp new file mode 100644 index 0000000..d5a5e3b --- /dev/null +++ b/src/management/builder/settings.cpp @@ -0,0 +1,29 @@ +#include "settings.hpp" +#include "checker/errors/settings/host_number.hpp" + +namespace smtp::manage::builder +{ + + smtp::manage::Settings Settings::Build() const + { + auto file_manipulator = GetFileSettings(); + return smtp::manage::Settings{file_manipulator}; + } + + file::Settings Settings::GetFileSettings() const + { + static const std::string PATH = "/var/lib/smtp/settings.txt"; + + auto registrator = BuildErrorRegistrator(); + return file::Settings{PATH, registrator}; + } + + checker::RegistratorSettings Settings::BuildErrorRegistrator() const + { + checker::RegistratorSettings result; + + result.Add( std::make_shared < checker::errors::settings::HostNumber >()); + return result; + } + +} diff --git a/src/management/builder/settings.hpp b/src/management/builder/settings.hpp new file mode 100644 index 0000000..67b7481 --- /dev/null +++ b/src/management/builder/settings.hpp @@ -0,0 +1,21 @@ +#pragma once + +#include "managment/settings.hpp" +#include "file/settings.hpp" +#include "checker/registrator_settings.hpp" + +namespace smtp::manage::builder +{ + class Settings + { + public: + Settings() = default; + ~Settings() = default; + + smtp::manage::Settings Build() const; + private: + file::Settings GetFileSettings() const; + checker::RegistratorSettings BuildErrorRegistrator() const; + }; + +} |