17 #include "../../util/btassert.h"
18 #include "../managers/cswordbackend.h"
19 #include "../keys/cswordversekey.h"
29 , m_boundsInitialized(false)
30 , m_lowerBound(nullptr)
31 , m_upperBound(nullptr)
41 auto & m = swordModule();
42 const bool oldStatus = m.isSkipConsecutiveLinks();
43 m.setSkipConsecutiveLinks(
true);
45 sword::VerseKey
const *
const key =
46 static_cast<sword::VerseKey *
>(m.getKey());
47 m_lowerBound.setVersification(key->getVersificationSystem());
48 m_upperBound.setVersification(key->getVersificationSystem());
50 m.setPosition(sword::TOP);
51 m_hasOT = (key->getTestament() == 1);
52 m_lowerBound.setKey(key->getText());
54 m.setPosition(sword::BOTTOM);
55 m_hasNT = (key->getTestament() == 2);
56 m_upperBound.setKey(key->getText());
58 m.setSkipConsecutiveLinks(oldStatus);
59 m_boundsInitialized =
true;
84 }
while (key.
next(CSwordVerseKey::JumpType::UseBook) &&
94 std::unique_ptr<sword::VerseKey> key(
96 key->setPosition(sword::TOP);
100 key->setPosition(sword::MAXCHAPTER);
101 result = key->getChapter();
113 const unsigned int chapter)
const
115 unsigned int result = 0;
117 std::unique_ptr<sword::VerseKey> key(
119 key->setPosition(sword::TOP);
123 key->setChapter(chapter);
124 key->setPosition(sword::MAXVERSE);
125 result = key->getVerse();
131 const unsigned int chapter)
const
139 std::unique_ptr<sword::VerseKey> key(
141 key->setPosition(sword::TOP);
143 key->setBookName(book.toUtf8().constData());
145 bookNumber = ((key->getTestament() > 1) ? key->BMAX[0] : 0) + key->getBook();
152 BT_ASSERT(
dynamic_cast<sword::VerseKey *
>(key));
153 return new CSwordVerseKey(
static_cast<sword::VerseKey *
>(key),
this);
The backend layer main class, a backend implementation of Sword.
QString booknameLanguage() const
Implementation for Sword Bibles.
unsigned int verseCount(const unsigned int book, const unsigned int chapter) const
CSwordVerseKey m_upperBound
unsigned int chapterCount(const unsigned int book) const
~CSwordBibleModuleInfo() noexcept override
CSwordBibleModuleInfo(sword::SWModule &module, CSwordBackend &backend, ModuleType type=Bible)
QStringList const & books() const
std::optional< QStringList > m_bookList
CSwordVerseKey m_lowerBound
unsigned int bookNumber(const QString &book) const
CSwordKey * createKey() const final override
CSwordBackend & backend() const
sword::SWModule & swordModule() const
CSwordKey implementation for Sword's VerseKey.
bool next(const JumpType type=JumpType::UseVerse)
QString key() const final override
bool setKey(const QString &key) final override
std::unique_ptr< CSwordBackend > backend(sword::InstallSource const &is)