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