1
/*****************************************************************************
2
* rawstr.h - code for class 'RawStr'- a module that reads raw text
3
* files: ot and nt using indexs ??.bks ??.cps ??.vss
4
* and provides lookup and parsing functions based on
7
* $Id: rawstr.h 2303 2009-04-06 13:38:34Z scribe $
9
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
10
* CrossWire Bible Society
12
* Tempe, AZ 85280-2528
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.
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.
36
class SWDLLEXPORT RawStr {
37
static int instance; // number of instantiated RawStr objects or derivitives
39
mutable long lastoff; // for caching and optimizing
45
void doSetText(const char *key, const char *buf, long len = -1);
46
void doLinkEntry(const char *destkey, const char *srckey);
47
static const int IDXENTRYSIZE;
51
RawStr(const char *ipath, int fileMode = -1);
53
void getIDXBuf(long ioffset, char **buf) const;
54
void getIDXBufDat(long ioffset, char **buf) const;
55
signed char findOffset(const char *key, __u32 *start, __u16 *size, long away = 0, __u32 *idxoff = 0) const;
56
void readText(__u32 start, __u16 *size, char **idxbuf, SWBuf &buf);
57
static signed char createModule(const char *path);