1
/******************************************************************************
2
* zld.cpp - code for class 'zLD'- a module that reads compressed lexicon and
5
* $Id: zld.h,v 1.8 2003/02/20 07:25:20 scribe Exp $
7
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
8
* CrossWire Bible Society
10
* Tempe, AZ 85280-2528
12
* This program is free software; you can redistribute it and/or modify it
13
* under the terms of the GNU General Public License as published by the
14
* Free Software Foundation version 2.
16
* This program is distributed in the hope that it will be useful, but
17
* WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19
* General Public License for more details.
33
class SWDLLEXPORT zLD : public zStr, public SWLD {
35
void strongsPad(char *buf);
36
char getEntry(long away = 0);
41
zLD(const char *ipath, const char *iname = 0, const char *idesc = 0, long blockCount = 200, SWCompress *icomp = 0, SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN,
42
const char* ilang = 0);
44
virtual SWBuf &getRawEntryBuf();
46
virtual void increment(int steps = 1);
47
virtual void decrement(int steps = 1) { increment(-steps); }
49
// write interface ----------------------------
50
virtual bool isWritable() {
51
return ((idxfd->getFd() > 0) && ((idxfd->mode & O_RDWR) == O_RDWR));
53
static char createModule(const char *path) {
54
return zStr::createModule(path);
57
virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
58
virtual void linkEntry(const SWKey *linkKey); // Link current module entry to other module entry
59
virtual void deleteEntry(); // Delete current module entry
60
// end write interface ------------------------
62
virtual void rawZFilter(SWBuf &buf, char direction = 0) { rawFilter(buf, (SWKey *)(long)direction); }// hack, use key as direction for enciphering
64
// swcacher interface ----------------------
65
virtual void flush() { flushCache(); }
66
// end swcacher interface ----------------------
69
// OPERATORS -----------------------------------------------------------------