diff options
Diffstat (limited to 'src/modules/common/rawstr4.cpp')
-rw-r--r-- | src/modules/common/rawstr4.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/modules/common/rawstr4.cpp b/src/modules/common/rawstr4.cpp index 003b2fe..e2ce899 100644 --- a/src/modules/common/rawstr4.cpp +++ b/src/modules/common/rawstr4.cpp @@ -1,11 +1,13 @@ /****************************************************************************** - * rawstr.cpp - code for class 'RawStr'- a module that reads raw text - * files: ot and nt using indexs ??.bks ??.cps ??.vss - * and provides lookup and parsing functions based on - * class StrKey * + * rawstr4.cpp - code for class 'RawStr'- a module that reads raw text + * files: ot and nt using indexs ??.bks ??.cps ??.vss + * and provides lookup and parsing functions based on + * class StrKey * - * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org) + * $Id: rawstr4.cpp 2833 2013-06-29 06:40:28Z chrislit $ + * + * Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -53,7 +55,7 @@ const int RawStr4::IDXENTRYSIZE = 8; * (e.g. 'modules/texts/rawtext/webster/') */ -RawStr4::RawStr4(const char *ipath, int fileMode) +RawStr4::RawStr4(const char *ipath, int fileMode, bool caseSensitive) : caseSensitive(caseSensitive) { SWBuf buf; @@ -121,7 +123,7 @@ void RawStr4::getIDXBufDat(long ioffset, char **buf) const datfd->read(*buf, size); } (*buf)[size] = 0; - toupperstr_utf8(*buf, size*2); + if (!caseSensitive) toupperstr_utf8(*buf, size*2); } else { *buf = (*buf) ? (char *)realloc(*buf, 1) : (char *)malloc(1); @@ -157,7 +159,7 @@ void RawStr4::getIDXBuf(long ioffset, char **buf) const } *targetbuf = 0; trybuf = 0; - toupperstr_utf8(targetbuf); + if (!caseSensitive) toupperstr_utf8(targetbuf); */ } } @@ -191,7 +193,7 @@ signed char RawStr4::findOffset(const char *ikey, __u32 *start, __u32 *size, lon headoff = 0; stdstr(&key, ikey, 3); - toupperstr_utf8(key, strlen(key)*3); + if (!caseSensitive) toupperstr_utf8(key, strlen(key)*3); int keylen = strlen(key); bool substr = false; @@ -311,7 +313,7 @@ signed char RawStr4::findOffset(const char *ikey, __u32 *start, __u32 *size, lon * */ -void RawStr4::readText(__u32 istart, __u32 *isize, char **idxbuf, SWBuf &buf) +void RawStr4::readText(__u32 istart, __u32 *isize, char **idxbuf, SWBuf &buf) const { unsigned int ch; char *idxbuflocal = 0; @@ -388,7 +390,7 @@ void RawStr4::doSetText(const char *ikey, const char *buf, long len) { char errorStatus = findOffset(ikey, &start, &size, 0, &idxoff); stdstr(&key, ikey, 3); - toupperstr_utf8(key, strlen(key)*3); + if (!caseSensitive) toupperstr_utf8(key, strlen(key)*3); len = (len < 0) ? strlen(buf) : len; getIDXBufDat(start, &dbKey); |