The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gbfosis.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * gbfosis.h - class GBFOSIS: a RenderFilter to render OSIS from modules
4  * marked up in GBF
5  *
6  * $Id: gbfosis.h 3786 2020-08-30 11:35:14Z scribe $
7  *
8  * Copyright 2002-2013 CrossWire Bible Society (http://www.crosswire.org)
9  * CrossWire Bible Society
10  * P. O. Box 2528
11  * Tempe, AZ 85280-2528
12  *
13  * This program is free software; you can redistribute it and/or modify it
14  * under the terms of the GNU General Public License as published by the
15  * Free Software Foundation version 2.
16  *
17  * This program is distributed in the hope that it will be useful, but
18  * WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * General Public License for more details.
21  *
22  */
23 
24 #ifndef GBFOSIS_H
25 #define GBFOSIS_H
26 
27 #include <swfilter.h>
28 #include <stack>
29 #include <swbuf.h>
30 
32 
33 
35 private:
36  class QuoteInstance {
37  public:
38  char startChar;
39  char level;
42  QuoteInstance(char startChar = '\"', char level = 1, SWBuf uniqueID = "", char continueCount = 0) {
43  this->startChar = startChar;
44  this->level = level;
45  this->uniqueID = uniqueID;
46  this->continueCount = continueCount;
47  }
48  void pushStartStream(SWBuf &text);
49  };
50 
51  typedef std::stack<QuoteInstance> QuoteInstanceStack;
53 public:
54  QuoteStack();
55  virtual ~QuoteStack();
56  void handleQuote(char *buf, char *quotePos, SWBuf &text);
57  void clear();
58  bool empty() { return quotes.empty(); }
59 };
60 
63 class SWDLLEXPORT GBFOSIS : public SWFilter {
64 public:
65  GBFOSIS();
66  virtual ~GBFOSIS();
67  char processText(SWBuf &text, const SWKey *key = 0, const SWModule *module = 0);
68 };
69 
71 #endif /* THMLOSIS_H */
#define SWORD_NAMESPACE_START
Definition: defs.h:39
Definition: swbuf.h:47
#define SWDLLEXPORT
Definition: defs.h:171
std::stack< QuoteInstance > QuoteInstanceStack
Definition: gbfosis.h:51
QuoteInstance(char startChar= '\"', char level = 1, SWBuf uniqueID = "", char continueCount = 0)
Definition: gbfosis.h:42
SWText * module
Definition: osis2mod.cpp:105
QuoteInstanceStack quotes
Definition: gbfosis.h:52
bool empty()
Definition: gbfosis.h:58
virtual char processText(SWBuf &text, const SWKey *key=0, const SWModule *module=0)=0
#define SWORD_NAMESPACE_END
Definition: defs.h:40
Definition: swkey.h:77