summaryrefslogtreecommitdiff
path: root/src/file/converter/file.hpp
diff options
context:
space:
mode:
authoreportnov <eportnov@ibs.ru>2022-09-13 15:03:25 +0300
committereportnov <eportnov@ibs.ru>2022-09-13 15:03:25 +0300
commite8aeea36e6b48e18d27f9d7857cd29524cc8aa1f (patch)
treeb99540f810072b746d033d6cd8d06aabb75afcad /src/file/converter/file.hpp
parenta58088ec7a45bb86b155a8ef9514b35b0ba8d1c9 (diff)
downloadobmc-sila-smtp-bugfix/write_file.tar.xz
add writing filesbugfix/write_file
Diffstat (limited to 'src/file/converter/file.hpp')
-rw-r--r--src/file/converter/file.hpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/file/converter/file.hpp b/src/file/converter/file.hpp
new file mode 100644
index 0000000..63ff6dd
--- /dev/null
+++ b/src/file/converter/file.hpp
@@ -0,0 +1,30 @@
+#pragma once
+
+#include <unordered_map>
+#include <string>
+
+#include "managment/general.hpp"
+
+namespace smtp::file::converter
+{
+ class File
+ {
+ public:
+ File() = default;
+ ~File() = default;
+
+ manage::SettingsFields Convert( manage::SettingsFileDataType const& from ) const;
+ private:
+ void ApplyAuth( manage::SettingsFields& result, manage::SettingsFileDataType const& from ) const;
+ void ApplySsl( manage::SettingsFields& result, manage::SettingsFileDataType const& from ) const;
+ void ApplyBool( manage::SettingsFileDataType const& from, std::string const& search_field, bool& field ) const;
+
+ void ApplyUsername( manage::SettingsFields& result, manage::SettingsFileDataType const& from ) const;
+ void ApplyPassword( manage::SettingsFields& result, manage::SettingsFileDataType const& from ) const;
+ void ApplyHost( manage::SettingsFields& result, manage::SettingsFileDataType const& from ) const;
+ void ApplyPort( manage::SettingsFields& result, manage::SettingsFileDataType const& from ) const;
+ void ApplyString( manage::SettingsFileDataType const& from, std::string const& search_field, std::string& field ) const;
+ };
+}
+
+