BibleTime
gbftohtml.h
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-2026 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#pragma once
14
15// Sword includes:
16#ifdef __GNUC__
17#pragma GCC diagnostic push
18#pragma GCC diagnostic ignored "-Wextra-semi"
19#pragma GCC diagnostic ignored "-Wsuggest-override"
20#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
21#endif
22#ifdef __clang__
23#pragma clang diagnostic push
24#pragma clang diagnostic ignored "-Wsuggest-destructor-override"
25#endif
26#include <gbfhtml.h>
27#include <swbasicfilter.h>
28#ifdef __clang__
29#pragma clang diagnostic pop
30#endif
31#ifdef __GNUC__
32#pragma GCC diagnostic pop
33#endif
34
35
36namespace sword {
37class SWBuf;
38class SWKey;
39class SWModule;
40} // namespace sword
41
42namespace Filters {
43
44/**
45 \brief GBF to HTML conversion filter.
46*/
47class GbfToHtml: public sword::GBFHTML {
48 protected: // types:
50 public:
51 UserData(sword::SWModule const * module,
52 sword::SWKey const * key)
53 : sword::GBFHTML::MyUserData(module, key),
55 {
56 hasFootnotePreTag = false;
57 }
58
59 short unsigned int swordFootnote;
60 };
61
62 public: // methods:
63 GbfToHtml();
64
65 /** Reimplemented from sword::OSISHTMLHREF. */
66 bool handleToken(sword::SWBuf &buf,
67 const char *token,
68 sword::BasicFilterUserData *userData) override;
69
70 /** Reimplemented from sword::SWFilter. */
71 char processText(sword::SWBuf &buf,
72 const sword::SWKey *key,
73 const sword::SWModule *module = nullptr) override;
74
75 protected: // methods:
76 /** Reimplemented from sword::OSISHTMLHREF. */
77 sword::BasicFilterUserData * createUserData(
78 sword::SWModule const * module,
79 sword::SWKey const * key) override
80 { return new UserData(module, key); }
81};
82
83} // namespace Filters
short unsigned int swordFootnote
Definition gbftohtml.h:59
UserData(sword::SWModule const *module, sword::SWKey const *key)
Definition gbftohtml.h:51
GBF to HTML conversion filter.
Definition gbftohtml.h:47
sword::BasicFilterUserData * createUserData(sword::SWModule const *module, sword::SWKey const *key) override
Definition gbftohtml.h:77
bool handleToken(sword::SWBuf &buf, const char *token, sword::BasicFilterUserData *userData) override
char processText(sword::SWBuf &buf, const sword::SWKey *key, const sword::SWModule *module=nullptr) override
Definition gbftohtml.cpp:89