From 7a00574163029c0c2b649878c95d5acbd083564a Mon Sep 17 00:00:00 2001 From: "Roberto C. Sanchez" Date: Mon, 12 May 2014 08:21:30 -0400 Subject: Imported Upstream version 1.7.2+dfsg --- src/modules/common/rawstr.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/modules/common/rawstr.cpp') diff --git a/src/modules/common/rawstr.cpp b/src/modules/common/rawstr.cpp index 6f17628..788ab6e 100644 --- a/src/modules/common/rawstr.cpp +++ b/src/modules/common/rawstr.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 * + * 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 * - * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org) + * $Id: rawstr.cpp 2833 2013-06-29 06:40:28Z chrislit $ + * + * Copyright 1998-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -54,7 +56,7 @@ const int RawStr::IDXENTRYSIZE = 6; * (e.g. 'modules/texts/rawtext/webster/') */ -RawStr::RawStr(const char *ipath, int fileMode) +RawStr::RawStr(const char *ipath, int fileMode, bool caseSensitive) : caseSensitive(caseSensitive) { SWBuf buf; @@ -121,7 +123,7 @@ void RawStr::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); @@ -181,7 +183,7 @@ signed char RawStr::findOffset(const char *ikey, __u32 *start, __u16 *size, long 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; @@ -302,7 +304,7 @@ signed char RawStr::findOffset(const char *ikey, __u32 *start, __u16 *size, long * */ -void RawStr::readText(__u32 istart, __u16 *isize, char **idxbuf, SWBuf &buf) +void RawStr::readText(__u32 istart, __u16 *isize, char **idxbuf, SWBuf &buf) const { unsigned int ch; char *idxbuflocal = 0; @@ -380,7 +382,7 @@ void RawStr::doSetText(const char *ikey, const char *buf, long len) char errorStatus = findOffset(ikey, &start, &size, 0, &idxoff); stdstr(&key, ikey, 2); - toupperstr_utf8(key, strlen(key)*2); + if (!caseSensitive) toupperstr_utf8(key, strlen(key)*2); len = (len < 0) ? strlen(buf) : len; -- cgit v1.2.3