BibleTime
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
Functions
a
b
c
d
e
f
g
h
i
l
m
n
p
q
r
s
t
v
Variables
a
b
c
d
g
h
i
k
l
m
p
r
s
u
Typedefs
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
p
r
s
t
u
w
Properties
Related Symbols
Files
File List
File Members
All
a
b
c
e
f
h
i
j
k
l
m
o
p
r
s
t
u
w
Functions
b
c
f
i
j
l
m
o
p
r
t
Variables
Typedefs
Enumerations
Enumerator
Macros
a
b
c
i
l
m
r
s
t
u
w
src
backend
managers
btlocalemgr.cpp
Go to the documentation of this file.
1
/*********
2
*
3
* In the name of the Father, and of the Son, and of the Holy Spirit.
4
*
5
* This file is part of BibleTime's source code, https://bibletime.info/
6
*
7
* Copyright 1999-2025 by the BibleTime developers.
8
* The BibleTime source code is licensed under the GNU General Public License
9
* version 2.0.
10
*
11
**********/
12
13
#include "
btlocalemgr.h
"
14
15
#include <QByteArray>
16
#include "../../util/btassert.h"
17
18
// Sword includes:
19
#pragma GCC diagnostic push
20
#pragma GCC diagnostic ignored "-Wextra-semi"
21
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
22
#include <localemgr.h>
23
#pragma GCC diagnostic pop
24
25
namespace
{
26
27
struct
BtLocaleMgrImpl
final:
public
sword::LocaleMgr {
28
29
friend
sword::LocaleMap
const
&
::BtLocaleMgr::internalSwordLocales
();
30
31
};
27
struct
BtLocaleMgrImpl
final:
public
sword::LocaleMgr {
…
};
32
33
BtLocaleMgrImpl
&
btLocaleMgrInstance
() {
34
auto
* btLocaleMgr =
35
dynamic_cast<
BtLocaleMgrImpl
*
>
(
36
sword::LocaleMgr::getSystemLocaleMgr());
37
if
(!btLocaleMgr) {
38
/* Beware that sword::StringMgr::setSystemStringMgr() also replaces the
39
Sword system locale manager with new sword::LocaleMgr(). */
40
btLocaleMgr =
new
BtLocaleMgrImpl
();
41
sword::LocaleMgr::setSystemLocaleMgr(btLocaleMgr);
42
}
43
return
*btLocaleMgr;
44
}
33
BtLocaleMgrImpl
&
btLocaleMgrInstance
() {
…
}
45
46
}
// anonymous namespace
25
namespace
{
…
}
47
48
auto
BtLocaleMgr::internalSwordLocales
() -> sword::LocaleMap
const
& {
49
auto
const
& btLocaleMgr =
btLocaleMgrInstance
();
50
BT_ASSERT
(btLocaleMgr.locales);
51
return
*btLocaleMgr.locales;
52
}
48
auto
BtLocaleMgr::internalSwordLocales
() -> sword::LocaleMap
const
& {
…
}
53
54
sword::SWLocale *
BtLocaleMgr::localeTranslator
()
55
{
return
btLocaleMgrInstance
().getLocale(
"locales"
); }
54
sword::SWLocale *
BtLocaleMgr::localeTranslator
() {
…
}
56
57
QString
BtLocaleMgr::defaultLocaleName
()
58
{
return
btLocaleMgrInstance
().getDefaultLocaleName(); }
57
QString
BtLocaleMgr::defaultLocaleName
() {
…
}
59
60
void
BtLocaleMgr::setDefaultLocaleName
(QString
const
& localeName) {
61
static_cast<
sword::LocaleMgr &
>
(
btLocaleMgrInstance
()).
setDefaultLocaleName
(
62
localeName.toUtf8().constData());
63
}
60
void
BtLocaleMgr::setDefaultLocaleName
(QString
const
& localeName) {
…
}
BT_ASSERT
#define BT_ASSERT(...)
Definition
btassert.h:17
btlocalemgr.h
BtLocaleMgr::defaultLocaleName
QString defaultLocaleName()
Definition
btlocalemgr.cpp:57
BtLocaleMgr::localeTranslator
sword::SWLocale * localeTranslator()
Definition
btlocalemgr.cpp:54
BtLocaleMgr::internalSwordLocales
std::map< sword::SWBuf, sword::SWLocale * > const & internalSwordLocales()
Definition
btlocalemgr.cpp:48
BtLocaleMgr::setDefaultLocaleName
void setDefaultLocaleName(QString const &localeName)
Definition
btlocalemgr.cpp:60
anonymous_namespace{btlocalemgr.cpp}::btLocaleMgrInstance
BtLocaleMgrImpl & btLocaleMgrInstance()
Definition
btlocalemgr.cpp:33
anonymous_namespace{btlocalemgr.cpp}::BtLocaleMgrImpl
Definition
btlocalemgr.cpp:27
Generated by
1.9.8