Changeset 632 for trunk/src


Ignore:
Timestamp:
Mar 5, 2010, 1:38:54 AM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

3rdparty/clucene: Made it build in _ASCII mode.

Location:
trunk/src/3rdparty/clucene/src/CLucene
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/3rdparty/clucene/src/CLucene/index/CompoundFile.cpp

    r2 r632  
    1111#include "CLucene/util/Misc.h"
    1212
     13#include "qclucene_global_p.h"
     14
    1315CL_NS_USE(store)
    1416CL_NS_USE(util)
     
    7274            int64_t offset = stream->readLong();
    7375            int32_t read = stream->readString(tid, CL_MAX_PATH);
    74             QString aid(QString::fromWCharArray(tid, read));
     76            QString aid = TCharToQString(tid, read);
    7577
    7678            // set length of the previous entry
     
    294296                fe->directoryOffset = os->getFilePointer();
    295297                os->writeLong(0);    // for now
    296                 tfile[fe->file.toWCharArray(tfile)] = '\0';
     298                tfile[QStringToTChar(fe->file, tfile)] = '\0';
    297299                os->writeString(tfile, _tcslen(tfile));
    298300            }
  • trunk/src/3rdparty/clucene/src/CLucene/index/IndexWriter.cpp

    r2 r632  
    1717#include "SegmentInfos.h"
    1818#include "SegmentMerger.h"
     19
     20#include "qclucene_global_p.h"
    1921
    2022CL_NS_USE(store)
     
    473475        for (int32_t i = input->readInt(); i > 0; i--) {
    474476            int32_t read = input->readString(tname, CL_MAX_PATH);
    475             result.push_back(QString::fromWCharArray(tname, read));
     477            result.push_back(TCharToQString(tname, read));
    476478        }
    477479    } _CLFINALLY (
     
    516518        QStringList::const_iterator itr;
    517519        for (itr  = files.begin(); itr != files.end(); ++itr) {
    518             tfile[(*itr).toWCharArray(tfile)] = '\0';
     520            tfile[QStringToTChar(*itr, tfile)] = '\0';
    519521            output->writeString(tfile, _tcslen(tfile));
    520522        }
  • trunk/src/3rdparty/clucene/src/CLucene/index/SegmentInfos.cpp

    r2 r632  
    1212#include "CLucene/store/Directory.h"
    1313#include "CLucene/util/Misc.h"
     14
     15#include "qclucene_global_p.h"
    1416
    1517CL_NS_USE(store)
     
    207209
    208210                //Write the name of the current segment
    209                 int32_t count = si->name.toWCharArray(tname);
     211                int32_t count = QStringToTChar(si->name, tname);
    210212                tname[count] = '\0';
    211213                output->writeString(tname, _tcslen(tname));
  • trunk/src/3rdparty/clucene/src/CLucene/index/TermInfosReader.cpp

    r2 r632  
    217217    }
    218218
    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;
    223229}
    224230
     
    238244    //Retrieve the indexOffset for term
    239245    int32_t indexOffset = getIndexOffset(term);
     246    if (indexOffset < 0)
     247        return -1;
     248
    240249    seekEnum(indexOffset);
    241250
     
    339348    //Pre  - term holds a reference to a valid term
    340349    //       indexTerms != NULL
    341     //Post - The new offset has been returned
     350    //Post - The new offset has been returned or -1 if all entries are greater
    342351
    343352    //Check if is indexTerms is a valid array
  • trunk/src/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp

    r561 r632  
    1919#include "CLucene/debug/condition.h"
    2020
     21#include "qclucene_global_p.h"
     22
    2123CL_NS_DEF(store)
    2224CL_NS_USE(util)
     
    560562
    561563    TCHAR tBuffer[2048] = { 0 };
    562     dirName.toWCharArray(tBuffer);
     564    QStringToTChar(dirName, tBuffer);
    563565   
    564566    char aBuffer[4096] = { 0 };
Note: See TracChangeset for help on using the changeset viewer.