The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rawld.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * rawld.cpp - class RawLD: a module driver that supports
4  * lexicon and dictionary files
5  * with entry sizes require up to 2 bytes
6  *
7  * $Id: rawld.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 RAWLD_H
26 #define RAWLD_H
27 
28 #include <rawstr.h>
29 #include <swld.h>
30 
31 #include <defs.h>
32 
34 
35 class SWDLLEXPORT RawLD : public RawStr, public SWLD {
36 
37 private:
38  char getEntry(long away = 0) const;
39 
40 public:
41  RawLD(const char *ipath, const char *iname = 0, const char *idesc = 0,
42  SWDisplay *idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
44  SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0, bool caseSensitive = false, bool strongsPadding = true);
45 
46  virtual ~RawLD();
47  virtual SWBuf &getRawEntryBuf() const;
48 
49  virtual void increment(int steps = 1);
50  virtual void decrement(int steps = 1) { increment(-steps); }
51  // write interface ----------------------------
52  virtual bool isWritable() const;
53  static char createModule(const char *path) { return RawStr::createModule (path); }
54 
55  virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
56  virtual void linkEntry(const SWKey *linkKey); // Link current module entry to other module entry
57  virtual void deleteEntry(); // Delete current module entry
58  // end write interface ------------------------
59  virtual long getEntryCount() const;
60  virtual long getEntryForKey(const char *key) const;
61  virtual char *getKeyForEntry(long entry) const;
62 
63 
64  // OPERATORS -----------------------------------------------------------------
65 
67 
68 };
69 
71 #endif
#define SWTextEncoding
Definition: swmodule.h:78
#define SWORD_NAMESPACE_START
Definition: defs.h:39
virtual long getEntryCount() const =0
Definition: swbuf.h:47
#define SWDLLEXPORT
Definition: defs.h:171
virtual void deleteEntry()
Definition: swmodule.h:525
virtual void setEntry(const char *inbuf, long len=-1)
Definition: swmodule.cpp:1680
Definition: rawld.h:35
virtual long getEntryForKey(const char *key) const =0
virtual void linkEntry(const SWKey *sourceKey)
Definition: swmodule.cpp:1683
static char createModule(const char *path)
Definition: rawld.h:53
virtual bool isWritable() const
Definition: swmodule.h:506
virtual void decrement(int steps=1)
Definition: rawld.h:50
virtual void increment(int steps=1)
Definition: swmodule.cpp:355
Definition: rawstr.h:35
virtual SWBuf & getRawEntryBuf() const =0
#define SWMODULE_OPERATORS
Definition: swmodule.h:54
virtual char * getKeyForEntry(long entry) const =0
#define SWTextDirection
Definition: swmodule.h:77
#define SWORD_NAMESPACE_END
Definition: defs.h:40
Definition: swkey.h:77
Definition: swld.h:36
#define SWTextMarkup
Definition: swmodule.h:79
static signed char createModule(const char *path)
Definition: rawstr.cpp:502