The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rawverse4.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * rawverse4.h - class RawVerse4: a helper class for module drivers
4  * which store uncompressed text, use 4 bytes entry size
5  * and use VerseKey as their keytype
6  *
7  * $Id: rawverse4.h 3786 2020-08-30 11:35:14Z scribe $
8  *
9  * Copyright 2007-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 
26 #ifndef RAWVERSE4_H
27 #define RAWVERSE4_H
28 
29 
30 #include <defs.h>
31 
33 
34 class FileDesc;
35 class SWBuf;
36 
38 
39 private:
40  static int instance; // number of instantiated RawVerse objects or derivitives
41 
42 protected:
43  FileDesc *idxfp[2];
44  FileDesc *textfp[2];
45 
46  char *path;
47  void doSetText(char testmt, long idxoff, const char *buf, long len = -1);
48  void doLinkEntry(char testmt, long destidxoff, long srcidxoff);
49 
50 public:
51  static const char nl;
52  RawVerse4(const char *ipath, int fileMode = -1);
53  virtual ~RawVerse4();
54  void findOffset(char testmt, long idxoff, long *start, unsigned long *end) const;
55  void readText(char testmt, long start, unsigned long size, SWBuf &buf) const;
56  static char createModule(const char *path, const char *v11n = "KJV");
57 };
58 
60 #endif
#define SWORD_NAMESPACE_START
Definition: defs.h:39
static int instance
Definition: rawverse4.h:40
Definition: swbuf.h:47
#define SWDLLEXPORT
Definition: defs.h:171
char * path
Definition: rawverse4.h:46
SWBuf v11n
Definition: osis2mod.cpp:107
int size
Definition: regex.c:5043
#define SWORD_NAMESPACE_END
Definition: defs.h:40
static const char nl
Definition: rawverse4.h:51