diff options
author | claiff <claiff@mail.ru> | 2022-10-06 12:26:56 +0300 |
---|---|---|
committer | claiff <claiff@mail.ru> | 2022-10-06 12:26:56 +0300 |
commit | 04e97b30880c1c3252fe900ccac268267539e424 (patch) | |
tree | 1f4cd2d1e2f8cf2442d055c519d06c6e0692febc /src/converter/file_to_struct.cpp | |
parent | 8edef99a5b52643e0b919c424357752cbbc9a8dd (diff) | |
parent | da5f91a0ce15351a82beb061c3ccc965164529bc (diff) | |
download | obmc-sila-smtp-04e97b30880c1c3252fe900ccac268267539e424.tar.xz |
Merge branch 'bugfix/proxy_file_reader'
Diffstat (limited to 'src/converter/file_to_struct.cpp')
-rw-r--r-- | src/converter/file_to_struct.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/converter/file_to_struct.cpp b/src/converter/file_to_struct.cpp index 4c4bec8..4cb588c 100644 --- a/src/converter/file_to_struct.cpp +++ b/src/converter/file_to_struct.cpp @@ -2,9 +2,9 @@ namespace smtp::converter { - manage::SettingsFields FileToStruct::Convert( manage::SettingsFileDataType const& from ) const + general::SettingsFields FileToStruct::Convert( general::SettingsFileDataType const& from ) const { - manage::SettingsFields result; + general::SettingsFields result; ApplyAuth( result, from ); ApplySsl( result, from ); @@ -16,21 +16,21 @@ namespace smtp::converter return result; } - void FileToStruct::ApplyAuth( manage::SettingsFields &result, manage::SettingsFileDataType const& from ) const + void FileToStruct::ApplyAuth( general::SettingsFields &result, general::SettingsFileDataType const& from ) const { static const std::string FIELD = "is_need_auth"; ApplyBool(from, FIELD, result.is_need_auth); } - void FileToStruct::ApplySsl( manage::SettingsFields &result, manage::SettingsFileDataType const& from ) const + void FileToStruct::ApplySsl( general::SettingsFields &result, general::SettingsFileDataType const& from ) const { static const std::string FIELD = "is_need_ssl"; ApplyBool(from, FIELD, result.is_need_ssl); } - void FileToStruct::ApplyBool( manage::SettingsFileDataType const& from, std::string const& search_field, bool& field ) const + void FileToStruct::ApplyBool( general::SettingsFileDataType const& from, std::string const& search_field, bool& field ) const { static const std::string TRUE_AS_STRING = "true"; static const std::string FALSE_AS_STRING = "false"; @@ -47,35 +47,35 @@ namespace smtp::converter field = (find->second == TRUE_AS_STRING); } - void FileToStruct::ApplyUsername( manage::SettingsFields &result, manage::SettingsFileDataType const& from ) const + void FileToStruct::ApplyUsername( general::SettingsFields &result, general::SettingsFileDataType const& from ) const { static const std::string FIELD = "username"; ApplyString( from, FIELD, result.username ); } - void FileToStruct::ApplyPassword( manage::SettingsFields &result, manage::SettingsFileDataType const& from ) const + void FileToStruct::ApplyPassword( general::SettingsFields &result, general::SettingsFileDataType const& from ) const { static const std::string FIELD = "password"; ApplyString( from, FIELD, result.password ); } - void FileToStruct::ApplyHost( manage::SettingsFields &result, manage::SettingsFileDataType const& from ) const + void FileToStruct::ApplyHost( general::SettingsFields &result, general::SettingsFileDataType const& from ) const { static const std::string FIELD = "host"; ApplyString( from, FIELD, result.host ); } - void FileToStruct::ApplyPort( manage::SettingsFields &result, manage::SettingsFileDataType const& from ) const + void FileToStruct::ApplyPort( general::SettingsFields &result, general::SettingsFileDataType const& from ) const { static const std::string FIELD = "port"; ApplyString(from, FIELD, result.port); } - void FileToStruct::ApplyString( manage::SettingsFileDataType const& from, std::string const& search_field, std::string& field ) const + void FileToStruct::ApplyString( general::SettingsFileDataType const& from, std::string const& search_field, std::string& field ) const { auto find = from.find( search_field ); if( find == from.end() ) |