~ubuntu-branches/debian/squeeze/sword/squeeze

« back to all changes in this revision

Viewing changes to include/zld.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Glassey
  • Date: 2004-01-15 15:50:07 UTC
  • Revision ID: james.westby@ubuntu.com-20040115155007-n9mz4x0zxrs1isd3
Tags: upstream-1.5.7
ImportĀ upstreamĀ versionĀ 1.5.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/******************************************************************************
 
2
 *  zld.cpp - code for class 'zLD'- a module that reads compressed lexicon and
 
3
 *                              dictionary files.
 
4
 *
 
5
 * $Id: zld.h,v 1.8 2003/02/20 07:25:20 scribe Exp $
 
6
 *
 
7
 * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
 
8
 *      CrossWire Bible Society
 
9
 *      P. O. Box 2528
 
10
 *      Tempe, AZ  85280-2528
 
11
 *
 
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.
 
15
 *
 
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.
 
20
 *
 
21
 */
 
22
 
 
23
#ifndef ZLD_H
 
24
#define ZLD_H
 
25
 
 
26
#include <zstr.h>
 
27
#include <swld.h>
 
28
 
 
29
#include <defs.h>
 
30
 
 
31
SWORD_NAMESPACE_START
 
32
 
 
33
class SWDLLEXPORT zLD : public zStr, public SWLD {
 
34
 
 
35
        void strongsPad(char *buf);
 
36
        char getEntry(long away = 0);
 
37
 
 
38
public:
 
39
 
 
40
 
 
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);
 
43
        virtual ~zLD();
 
44
        virtual SWBuf &getRawEntryBuf();
 
45
 
 
46
        virtual void increment(int steps = 1);
 
47
        virtual void decrement(int steps = 1) { increment(-steps); }
 
48
 
 
49
        // write interface ----------------------------
 
50
        virtual bool isWritable() {
 
51
                return ((idxfd->getFd() > 0) && ((idxfd->mode & O_RDWR) == O_RDWR));
 
52
        }
 
53
        static char createModule(const char *path) {
 
54
                return zStr::createModule(path);
 
55
        }
 
56
 
 
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 ------------------------
 
61
 
 
62
        virtual void rawZFilter(SWBuf &buf, char direction = 0) { rawFilter(buf, (SWKey *)(long)direction); }// hack, use key as direction for enciphering
 
63
  
 
64
        // swcacher interface ----------------------
 
65
        virtual void flush() { flushCache(); }
 
66
        // end swcacher interface ----------------------
 
67
 
 
68
 
 
69
        // OPERATORS -----------------------------------------------------------------
 
70
        
 
71
        SWMODULE_OPERATORS
 
72
 
 
73
};
 
74
 
 
75
SWORD_NAMESPACE_END
 
76
#endif