summaryrefslogtreecommitdiff
path: root/src/file/settings.hpp
blob: 62182b17bb3a43af82eee62a5a888bf4e2e18afa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once

#include <list>
#include <string>

#include "settings_converter.hpp"
#include "parser/settings.hpp"

namespace smtp::file
{
    using ParsedStoreType = std::unordered_map<std::string, std::string>;

    class Settings
    {
    public:
        explicit Settings( std::string const& path_file, parser::Settings const& parser, SettingsConverter const& converter );
        ~Settings() = default;

        SettingsFields Read() const;
        void Write( SettingsFields const& settings_fields ) const;
    private:
        ParsedStoreType GetParsedStore() const;
        void SetParsedData() const;

        std::string mPathFile;
        parser::Settings mParser;
        SettingsConverter mConverter;

    };

}