blob: a7ccda1fcfd36945315e2b1d93cd9bdc50716e3f (
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#include "checker_decorator.hpp"
namespace smtp::file::settings
{
//
//Constructors
//
CheckerDecorator::CheckerDecorator( checker::RegistratorSettings const& registrator_errors )
: mRegistratorErrors( registrator_errors )
{
}
//
//Public methods
//
general::SettingsFileDataType CheckerDecorator::Read() const
{
general::SettingsFileDataType result;
if(!mBase)
{
return result;
}
result = mBase->Read();
if(result.empty())
{
return result;
}
return mRegistratorErrors.Check( result ) ? result : general::SettingsFileDataType{};
}
bool CheckerDecorator::Write( general::SettingsFileDataType const& settings_fields ) const
{
if( !mBase )
{
return false;
}
if( mRegistratorErrors.Check( settings_fields ) )
{
return mBase->Write(settings_fields);
}
return false;
}
}
|