cc_tools_qt
Common Environment for Protocol Analysis.
Loading...
Searching...
No Matches
ConfigMgr.h
1//
2// Copyright 2015 - 2024 (C). Alex Robenko. All rights reserved.
3//
4
5// This file is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18
19#pragma once
20
21#include <utility>
22#include <list>
23
24#include <QtCore/QString>
25#include <QtCore/QVariantMap>
26
27#include "Api.h"
28
29namespace cc_tools_qt
30{
31
32class CC_API ConfigMgr
33{
34public:
35
36 ConfigMgr();
37 ~ConfigMgr() noexcept;
38
39 const QString& getLastFile() const;
40 static const QString& getFilesFilter();
41
42 QVariantMap loadConfig(const QString& filename);
43 QVariantMap loadConfig(const QString& filename, bool updateAsLast);
44 bool saveConfig(const QString& filename, const QVariantMap& config);
45 bool saveConfig(const QString& filename, const QVariantMap& config, bool updateAsLast);
46
47private:
48
49 QString m_lastConfigFile;
50};
51
52} // namespace cc_tools_qt
53
54
Main namespace for all classes / functions of the shared library.