The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rawverse.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * rawverse.h - class RawVerse: a helper class for module drivers
4  * which store their data uncompress and use a 2 byte
5  * entry size and a VerseKey key type
6  *
7  * $Id: rawverse.h 3786 2020-08-30 11:35:14Z scribe $
8  *
9  * Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org)
10  * CrossWire Bible Society
11  * P. O. Box 2528
12  * Tempe, AZ 85280-2528
13  *
14  * This program is free software; you can redistribute it and/or modify it
15  * under the terms of the GNU General Public License as published by the
16  * Free Software Foundation version 2.
17  *
18  * This program is distributed in the hope that it will be useful, but
19  * WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  * General Public License for more details.
22  *
23  */
24 
25 #ifndef RAWVERSE_H
26 #define RAWVERSE_H
27 
28 
29 #include <defs.h>
30 
32 
33 class FileDesc;
34 class SWBuf;
35 
37 
38 private:
39  static int instance; // number of instantiated RawVerse objects or derivitives
40 
41 protected:
42  FileDesc *idxfp[2];
43  FileDesc *textfp[2];
44 
45  char *path;
46  void doSetText(char testmt, long idxoff, const char *buf, long len = -1);
47  void doLinkEntry(char testmt, long destidxoff, long srcidxoff);
48 
49 public:
50  static const char nl;
51  RawVerse(const char *ipath, int fileMode = -1);
52  virtual ~RawVerse();
53  void findOffset(char testmt, long idxoff, long *start, unsigned short *end) const;
54  void readText(char testmt, long start, unsigned short size, SWBuf &buf) const;
55  static char createModule(const char *path, const char *v11n = "KJV");
56 };
57 
59 #endif
#define SWORD_NAMESPACE_START
Definition: defs.h:39
Definition: swbuf.h:47
#define SWDLLEXPORT
Definition: defs.h:171
static const char nl
Definition: rawverse.h:50
SWBuf v11n
Definition: osis2mod.cpp:107
char * path
Definition: rawverse.h:45
int size
Definition: regex.c:5043
#define SWORD_NAMESPACE_END
Definition: defs.h:40
static int instance
Definition: rawverse.h:39