diff options
Diffstat (limited to 'include/zstr.h')
-rw-r--r-- | include/zstr.h | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/include/zstr.h b/include/zstr.h index f9842f4..81ed63d 100644 --- a/include/zstr.h +++ b/include/zstr.h @@ -1,12 +1,13 @@ /***************************************************************************** - * zstr.h - code for class 'zStr'- a module that reads compressed text - * files. - * and provides lookup and parsing functions based on - * class StrKey * - * $Id: zstr.h 2303 2009-04-06 13:38:34Z scribe $ + * zstr.h - code for class 'zStr'- a module that reads compressed text + * files. + * and provides lookup and parsing functions based on + * class StrKey * - * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org) + * $Id: zstr.h 2980 2013-09-14 21:51:47Z scribe $ + * + * Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -38,10 +39,11 @@ class SWDLLEXPORT zStr { private: static int instance; // number of instantiated zStr objects or derivitives - EntriesBlock *cacheBlock; - long cacheBlockIndex; - bool cacheDirty; + mutable EntriesBlock *cacheBlock; + mutable long cacheBlockIndex; + mutable bool cacheDirty; char *path; + bool caseSensitive; mutable long lastoff; // for caching and optimization long blockCount; SWCompress *compressor; @@ -54,20 +56,19 @@ protected: static const int IDXENTRYSIZE; static const int ZDXENTRYSIZE; - void getCompressedText(long block, long entry, char **buf); - void flushCache(); + void getCompressedText(long block, long entry, char **buf) const; + void flushCache() const; void getKeyFromDatOffset(long ioffset, char **buf) const; void getKeyFromIdxOffset(long ioffset, char **buf) const; public: - char nl; - zStr(const char *ipath, int fileMode = -1, long blockCount = 100, SWCompress *icomp = 0); + zStr(const char *ipath, int fileMode = -1, long blockCount = 100, SWCompress *icomp = 0, bool caseSensitive = false); virtual ~zStr(); signed char findKeyIndex(const char *ikey, long *idxoff, long away = 0) const; - void getText(long index, char **idxbuf, char **buf); + void getText(long index, char **idxbuf, char **buf) const; void setText(const char *ikey, const char *buf, long len = -1); void linkEntry(const char *destkey, const char *srckey); - virtual void rawZFilter(SWBuf &buf, char direction = 0) {} + virtual void rawZFilter(SWBuf &buf, char direction = 0) const { (void) buf; (void) direction; } static signed char createModule (const char *path); }; |