libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout-client-qt
include
osmscoutclientqt
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
23
#include <
osmscoutclientqt/ClientQtImportExport.h
>
24
25
#include <osmscoutclient/Settings.h>
26
27
#include <QObject>
28
#include <QSettings>
29
30
31
namespace
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
ClientQtImportExport.h
OSMSCOUT_CLIENT_QT_API
#define OSMSCOUT_CLIENT_QT_API
Definition
ClientQtImportExport.h:45
osmscout::QtSettingsStorage::GetBytes
std::vector< char > GetBytes(const std::string &key) override
osmscout::QtSettingsStorage::SetValue
void SetValue(const std::string &key, const std::string &str) override
osmscout::QtSettingsStorage::~QtSettingsStorage
virtual ~QtSettingsStorage()=default
osmscout::QtSettingsStorage::GetString
std::string GetString(const std::string &key, const std::string &defaultValue="") override
osmscout::QtSettingsStorage::SetValue
void SetValue(const std::string &key, std::vector< char > bytes) override
osmscout::QtSettingsStorage::SetValue
void SetValue(const std::string &key, bool b) override
osmscout::QtSettingsStorage::GetUInt
uint32_t GetUInt(const std::string &key, uint32_t defaultValue=0) override
osmscout::QtSettingsStorage::QtSettingsStorage
QtSettingsStorage(QSettings *providedStorage=nullptr)
osmscout::QtSettingsStorage::SetValue
void SetValue(const std::string &key, double d) override
osmscout::QtSettingsStorage::SetValue
void SetValue(const std::string &key, uint32_t i) override
osmscout::QtSettingsStorage::GetDouble
double GetDouble(const std::string &key, double defaultValue=0) override
osmscout::QtSettingsStorage::GetBool
bool GetBool(const std::string &key, bool defaultValue=0) override
osmscout::QtSettingsStorage::Keys
std::vector< std::string > Keys(const std::string &prefix) override
osmscout
Definition
Area.h:39
Generated by
1.17.0