#include "settings.hpp" #include "converter/string.hpp" namespace smtp::manage { Settings::Settings( file::Settings const& file_reader ) : mFileReader( file_reader ) { mSettingsFields = file_reader.Read(); } bool Settings::SetSettings( manage::SettingsFields const& settings_fields )const { return mFileReader.Write( settings_fields ); } std::string Settings::GetSettings() { mSettingsFields = mFileReader.Read(); return converter::String{}.Convert(mSettingsFields); } bool Settings::IsNeedAuth() const noexcept { return mSettingsFields.is_need_auth; } bool Settings::IsNeedSsl() const noexcept { return mSettingsFields.is_need_ssl; } std::string Settings::GetUserName() const { return mSettingsFields.username; } std::string Settings::GetPassword() const { return mSettingsFields.password; } std::string Settings::GetHost() const { return mSettingsFields.host; } std::string Settings::GetPort() const { return mSettingsFields.port; } }