summaryrefslogtreecommitdiff
path: root/src/management/builder/settings.cpp
blob: 0b27befc3789452a9f683bdc29e431284d358ef8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "settings.hpp"
#include "checker/errors/settings/port_number.hpp"
#include "checker/errors/settings/server.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::PortNumber >());
        result.Add( std::make_shared < checker::errors::settings::Server >());

		return result;
	}

}