Changeset 632
- Timestamp:
- Mar 5, 2010, 1:38:54 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/3rdparty/clucene/src/CLucene/index/CompoundFile.cpp
r2 r632 11 11 #include "CLucene/util/Misc.h" 12 12 13 14 13 15 CL_NS_USE(store) 14 16 CL_NS_USE(util) … … 72 74 int64_t offset = stream->readLong(); 73 75 int32_t read = stream->readString(tid, CL_MAX_PATH); 74 QString aid (QString::fromWCharArray(tid, read));76 QString aid); 75 77 76 78 // set length of the previous entry … … 294 296 fe->directoryOffset = os->getFilePointer(); 295 297 os->writeLong(0); // for now 296 tfile[ fe->file.toWCharArray(tfile)] = '\0';298 tfile[tfile)] = '\0'; 297 299 os->writeString(tfile, _tcslen(tfile)); 298 300 } -
trunk/src/3rdparty/clucene/src/CLucene/index/IndexWriter.cpp
r2 r632 17 17 #include "SegmentInfos.h" 18 18 #include "SegmentMerger.h" 19 20 19 21 20 22 CL_NS_USE(store) … … 473 475 for (int32_t i = input->readInt(); i > 0; i--) { 474 476 int32_t read = input->readString(tname, CL_MAX_PATH); 475 result.push_back( QString::fromWCharArray(tname, read));477 result.push_back((tname, read)); 476 478 } 477 479 } _CLFINALLY ( … … 516 518 QStringList::const_iterator itr; 517 519 for (itr = files.begin(); itr != files.end(); ++itr) { 518 tfile[ (*itr).toWCharArray(tfile)] = '\0';520 tfile[tfile)] = '\0'; 519 521 output->writeString(tfile, _tcslen(tfile)); 520 522 } -
trunk/src/3rdparty/clucene/src/CLucene/index/SegmentInfos.cpp
r2 r632 12 12 #include "CLucene/store/Directory.h" 13 13 #include "CLucene/util/Misc.h" 14 15 14 16 15 17 CL_NS_USE(store) … … 207 209 208 210 //Write the name of the current segment 209 int32_t count = si->name.toWCharArray(tname);211 int32_t count = tname); 210 212 tname[count] = '\0'; 211 213 output->writeString(tname, _tcslen(tname)); -
trunk/src/3rdparty/clucene/src/CLucene/index/TermInfosReader.cpp
r2 r632 217 217 } 218 218 219 //Reposition current term in the enumeration 220 seekEnum(getIndexOffset(term)); 221 //Return the TermInfo for term 222 return scanEnum(term); 219 //Reposition current term in the enumeration 220 int32_t indexOffset = getIndexOffset(term); 221 if (indexOffset >= 0) { 222 seekEnum(getIndexOffset(term)); 223 //Return the TermInfo for term 224 return scanEnum(term); 225 } 226 227 // term not found 228 return NULL; 223 229 } 224 230 … … 238 244 //Retrieve the indexOffset for term 239 245 int32_t indexOffset = getIndexOffset(term); 246 247 248 240 249 seekEnum(indexOffset); 241 250 … … 339 348 //Pre - term holds a reference to a valid term 340 349 // indexTerms != NULL 341 //Post - The new offset has been returned 350 //Post - The new offset has been returned 342 351 343 352 //Check if is indexTerms is a valid array -
trunk/src/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp
r561 r632 19 19 #include "CLucene/debug/condition.h" 20 20 21 22 21 23 CL_NS_DEF(store) 22 24 CL_NS_USE(util) … … 560 562 561 563 TCHAR tBuffer[2048] = { 0 }; 562 dirName.toWCharArray(tBuffer);564 tBuffer); 563 565 564 566 char aBuffer[4096] = { 0 }; -
trunk/tools/assistant/lib/fulltextsearch/qclucene_global_p.h
r561 r632 37 37 #include <QtCore/QString> 38 38 39 #if !defined(_MSC_VER) && defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T)39 #if !defined(_MSC_VER) 40 40 # if !defined(TCHAR) 41 # define TCHAR wchar_t 41 # if defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T) && !defined(_ASCII) 42 # define TCHAR wchar_t 43 # else 44 # define TCHAR char 45 # endif 42 46 # endif 43 47 #else … … 61 65 // ------------- 62 66 // 63 // adjustments here, need to be done in 67 // adjustments here, need to be done in 64 68 // QTDIR/src/3rdparty/clucene/src/CLucene/StdHeader.h as well 65 69 // … … 106 110 TCHAR* QStringToTChar(const QString &str) 107 111 { 108 TCHAR *string = new TCHAR[(str.length() +1) * sizeof(TCHAR)];109 memset(string, 0, (str.length() +1) * sizeof(TCHAR));110 #if defined(UNICODE) || defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T)112 113 ; 114 111 115 str.toWCharArray(string); 116 112 117 #else 113 const QByteArray ba = str.toAscii(); 118 const QByteArray ba = str.toLocal8Bit(); 119 char *string = new char[ba.length() + 1]; 114 120 strcpy(string, ba.constData()); 121 115 122 #endif 116 return string;117 123 } 118 124 119 QString TCharToQString(constTCHAR *string)125 TCHAR *string) 120 126 { 121 #if defined(UNICODE) || defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T) 122 QString retValue = QString::fromWCharArray(string); 127 #if (defined(UNICODE) || (defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T))) && !defined(_ASCII) 128 return str.toWCharArray(string); 129 #else 130 const QByteArray ba = str.toLocal8Bit(); 131 strncpy(string, ba.constData(), ba.length()); 132 return ba.length(); 133 #endif 134 } 135 136 QString TCharToQString(const TCHAR *string, int size = -1) 137 { 138 #if (defined(UNICODE) || (defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T))) && !defined(_ASCII) 139 QString retValue = QString::fromWCharArray(string, size); 123 140 return retValue; 124 141 #else 125 return QString (QLatin1String(string));142 return QString); 126 143 #endif 127 144 }
Note:
See TracChangeset
for help on using the changeset viewer.