diff options
Diffstat (limited to 'src/checker/errors/settings/host_number.cpp')
-rw-r--r-- | src/checker/errors/settings/host_number.cpp | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/checker/errors/settings/host_number.cpp b/src/checker/errors/settings/host_number.cpp deleted file mode 100644 index 3580265..0000000 --- a/src/checker/errors/settings/host_number.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "host_number.hpp" -#include "managment/logger.hpp" -#include <stdexcept> -namespace smtp::checker::errors::settings -{ - bool HostNumber::Check( const manage::SettingsFileDataType& line ) const - { - //TODO общее использование полей - auto find = line.find("host"); - if(find == line.end()) - { - manage::Logger::LogError("Host doesn't found"); - return false; - } - int host_as_int{}; - auto host_as_string = find->second; - if(host_as_string.empty()) - { - return true; - } - - try - { - host_as_int = std::stoi( host_as_string ); - } - catch( std::invalid_argument const& ex ) - { - manage::Logger::LogError("Host doesn't entered by numbers"); - } - catch( std::out_of_range const& ex ) - { - manage::Logger::LogError("Host out of range"); - } - return host_as_int >= 0 && host_as_int <= 65535; - } -} |