diff options
Diffstat (limited to 'include/rawstr.h')
-rw-r--r-- | include/rawstr.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/include/rawstr.h b/include/rawstr.h index 4367851..41d65d5 100644 --- a/include/rawstr.h +++ b/include/rawstr.h @@ -4,7 +4,7 @@ * and provides lookup and parsing functions based on * class StrKey * - * $Id: rawstr.h 1864 2005-11-20 06:06:40Z scribe $ + * $Id: rawstr.h 2303 2009-04-06 13:38:34Z scribe $ * * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society @@ -26,6 +26,7 @@ #define RAWSTR_H #include <defs.h> +#include <sysdata.h> SWORD_NAMESPACE_START @@ -35,22 +36,24 @@ class FileDesc; class SWDLLEXPORT RawStr { static int instance; // number of instantiated RawStr objects or derivitives char *path; - long lastoff; + mutable long lastoff; // for caching and optimizing + protected: FileDesc *idxfd; FileDesc *datfd; void doSetText(const char *key, const char *buf, long len = -1); void doLinkEntry(const char *destkey, const char *srckey); + static const int IDXENTRYSIZE; + public: - static void prepText(SWBuf &buf); static char nl; RawStr(const char *ipath, int fileMode = -1); virtual ~RawStr(); - void getIDXBuf(long ioffset, char **buf); - void getIDXBufDat(long ioffset, char **buf); - signed char findOffset(const char *key, long *start, unsigned short *size, long away = 0, long *idxoff = 0); - void readText(long start, unsigned short *size, char **idxbuf, SWBuf &buf); + void getIDXBuf(long ioffset, char **buf) const; + void getIDXBufDat(long ioffset, char **buf) const; + signed char findOffset(const char *key, __u32 *start, __u16 *size, long away = 0, __u32 *idxoff = 0) const; + void readText(__u32 start, __u16 *size, char **idxbuf, SWBuf &buf); static signed char createModule(const char *path); }; |