libosmscout 1.1.1
Loading...
Searching...
No Matches
QtSettingsStorage.h
Go to the documentation of this file.
1#ifndef OSMSCOUT_CLIENT_QT_QTSETTINGSSTORAGE_H
2#define OSMSCOUT_CLIENT_QT_QTSETTINGSSTORAGE_H
3
4/*
5 OSMScout - a Qt backend for libosmscout and libosmscout-map
6 Copyright (C) 2023 Lukas Karas
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21*/
22
24
25#include <osmscoutclient/Settings.h>
26
27#include <QObject>
28#include <QSettings>
29
30
31namespace osmscout {
32
33 class OSMSCOUT_CLIENT_QT_API QtSettingsStorage: public QObject, public SettingsStorage
34 {
35 private:
36 QSettings *storage;
37 public:
42 explicit QtSettingsStorage(QSettings *providedStorage=nullptr);
43 virtual ~QtSettingsStorage() = default;
44
45 void SetValue(const std::string &key, double d) override;
46 void SetValue(const std::string &key, uint32_t i) override;
47 void SetValue(const std::string &key, const std::string &str) override;
48 void SetValue(const std::string &key, bool b) override;
49 void SetValue(const std::string &key, std::vector<char> bytes) override;
50 double GetDouble(const std::string &key, double defaultValue = 0) override;
51 uint32_t GetUInt(const std::string &key, uint32_t defaultValue = 0) override;
52 std::string GetString(const std::string &key, const std::string &defaultValue = "") override;
53 bool GetBool(const std::string &key, bool defaultValue = 0) override;
54 std::vector<char> GetBytes(const std::string &key) override;
55
56 std::vector<std::string> Keys(const std::string &prefix) override;
57 };
58
59}
60#endif //OSMSCOUT_CLIENT_QT_QTSETTINGSSTORAGE_H
#define OSMSCOUT_CLIENT_QT_API
Definition ClientQtImportExport.h:45
std::vector< char > GetBytes(const std::string &key) override
void SetValue(const std::string &key, const std::string &str) override
virtual ~QtSettingsStorage()=default
std::string GetString(const std::string &key, const std::string &defaultValue="") override
void SetValue(const std::string &key, std::vector< char > bytes) override
void SetValue(const std::string &key, bool b) override
uint32_t GetUInt(const std::string &key, uint32_t defaultValue=0) override
QtSettingsStorage(QSettings *providedStorage=nullptr)
void SetValue(const std::string &key, double d) override
void SetValue(const std::string &key, uint32_t i) override
double GetDouble(const std::string &key, double defaultValue=0) override
bool GetBool(const std::string &key, bool defaultValue=0) override
std::vector< std::string > Keys(const std::string &prefix) override
Definition Area.h:39