summaryrefslogtreecommitdiff
path: root/src/file/parser/settings.cpp
diff options
context:
space:
mode:
authoreportnov <eportnov@ibs.ru>2022-09-13 11:13:38 +0300
committereportnov <eportnov@ibs.ru>2022-09-13 11:13:38 +0300
commita58088ec7a45bb86b155a8ef9514b35b0ba8d1c9 (patch)
tree95a796ba075edb1abf4edea29a11544fa7344754 /src/file/parser/settings.cpp
parentdf33492b80495fd36a1a488c0b0a39753f1df415 (diff)
parentdcbaf61e4968734d9b3bc41f704ea04d54746cea (diff)
downloadobmc-sila-smtp-a58088ec7a45bb86b155a8ef9514b35b0ba8d1c9.tar.xz
Merge branch 'feature/mail_user_managment'
Diffstat (limited to 'src/file/parser/settings.cpp')
-rw-r--r--src/file/parser/settings.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/file/parser/settings.cpp b/src/file/parser/settings.cpp
new file mode 100644
index 0000000..590ed72
--- /dev/null
+++ b/src/file/parser/settings.cpp
@@ -0,0 +1,20 @@
+#include "settings.hpp"
+
+namespace smtp::file::parser
+{
+ ParseResult Settings::Parse( std::string const& line ) const
+ {
+ static constexpr char DELIMITER = '=';
+ static constexpr size_t ZERO_POSITION = 0;
+ static constexpr size_t NEXT_POSITION = 1;
+
+ auto position = line.find(DELIMITER);
+ if( position == std::string::npos)
+ {
+ return {};
+ }
+ auto first_part = line.substr( ZERO_POSITION, position );
+ auto second_part = line.substr(position + NEXT_POSITION, line.length());
+ return {first_part, second_part};
+ }
+}