From: <ust...@us...> - 2008-08-03 10:03:29
|
Revision: 2853 http://clucene.svn.sourceforge.net/clucene/?rev=2853&view=rev Author: ustramooner Date: 2008-08-03 10:03:19 +0000 (Sun, 03 Aug 2008) Log Message: ----------- fixed discovered by dist-test.sh: non-inline code in headers (moved to cpp files) headers not compiling independently of each other moved Term_Compare and Term_Equals to private created a CLUCENE(_SHARED)_INLINE_EXPORT to work with ming, and to inform tests that something is meant to be inline virtual destructors for safe export fixed licenses Modified Paths: -------------- branches/lucene2_3_2/dist-test.sh branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.cpp branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h branches/lucene2_3_2/src/core/CLucene/index/DocumentWriter.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexReader.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexReader.h branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.h branches/lucene2_3_2/src/core/CLucene/index/Term.cpp branches/lucene2_3_2/src/core/CLucene/index/Term.h branches/lucene2_3_2/src/core/CLucene/search/Compare.h branches/lucene2_3_2/src/core/CLucene/search/Hits.h branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/ScorerDocQueue.h branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.h branches/lucene2_3_2/src/core/CLucene/search/Sort.cpp branches/lucene2_3_2/src/core/CLucene/search/Sort.h branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.cpp branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.h branches/lucene2_3_2/src/core/CLucene/store/Directory.cpp branches/lucene2_3_2/src/core/CLucene/store/Directory.h branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.cpp branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.h branches/lucene2_3_2/src/core/CLucene/store/IndexInput.cpp branches/lucene2_3_2/src/core/CLucene/store/IndexInput.h branches/lucene2_3_2/src/core/CLucene/util/Equators.h branches/lucene2_3_2/src/core/CLucene/util/PriorityQueue.h branches/lucene2_3_2/src/core/CLucene/util/Reader.h branches/lucene2_3_2/src/core/CLucene/util/VoidList.h branches/lucene2_3_2/src/core/CLucene/util/VoidMap.h branches/lucene2_3_2/src/core/CLucene/util/fileinputstream.h branches/lucene2_3_2/src/core/CLucene/util/stringreader.h branches/lucene2_3_2/src/core/CLucene/util/subinputstream.h branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h branches/lucene2_3_2/src/shared/CLucene/util/dirent.h Added Paths: ----------- branches/lucene2_3_2/src/core/CLucene/index/_Term.h Modified: branches/lucene2_3_2/dist-test.sh =================================================================== --- branches/lucene2_3_2/dist-test.sh 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/dist-test.sh 2008-08-03 10:03:19 UTC (rev 2853) @@ -8,7 +8,7 @@ echo "usage: ../dist-test.sh [all | " echo " <env - creates environment>" echo " <c_all - compile all headers together>" - echo " <t_all - run test-all>" + echo " <compile - compile and test>" echo " <inline - test for inline using doxygen documents>]" echo " <c_header - test that each header compiles independently of each other>]" echo " <license - test that each header has a valid license>]" @@ -20,11 +20,12 @@ t_env=0 t_c_all=0 t_inline=0 -t_t_all=0 +t_compile=0 t_c_h=0 t_license=0 t_ifdefs=0 t_exports=0 +FAIL=0 if [ $# == 0 ]; then usage @@ -38,8 +39,8 @@ t_c_all=1 elif [ "$1" == "inline" ]; then t_inline=1 - elif [ "$1" == "t_all" ]; then - t_t_all=1 + elif [ "$1" == "compile" ]; then + t_compile=1 elif [ "$1" == "c_header" ]; then t_c_h=1 elif [ "$1" == "license" ]; then @@ -60,7 +61,7 @@ t_c_all=1 t_c_h=1 t_inline=1 - t_t_all=1 + t_compile=1 t_license=1 t_ifdefs=1 t_exports=1 @@ -74,7 +75,7 @@ I=`expr $I + 1` if [ $I -gt 1 ]; then echo $1 has invalid ifdef: $line - exit 1 + FAIL=1 fi done } @@ -96,7 +97,7 @@ #move headers somewhere to compile mkdir -p "$TMP/$DH" 2>/dev/null - cp "$H" "$TMP/${H:3}" + ln -s "`realpath $H`" "$TMP/${H:3}" 2>/dev/null #create pub-headers.cpp echo "#include \"${H:7}\"" >>$TMP/pub-headers.cpp @@ -108,13 +109,22 @@ echo "int main(){return 0;}" >>$TMP/pub-headers.cpp fi +#find inline code: +if [ $t_inline == 1 ]; then + if [ $t_env == 1 ]; then + make doc + if [ $? != 0 ]; then + exit 1 + fi + fi +fi ################################################ #now the environment is finished being setup... ################################################ echo "Starting tests..." -if [ $t_c_h == 1 ] || [ $t_license == 1 ] || [ $t_ifdefs == 1 ] || [ $t_exports == 1 ]; then +if [ $t_c_h == 1 ] || [ $t_ifdefs == 1 ] || [ $t_exports == 1 ]; then for H in `find $TMP/src | grep "\.h$"`; do BH=`basename "$H"` DH=`dirname "${H:3}"` @@ -124,48 +134,85 @@ fi #check that all classes are exported - if [ $t_exports ]; then - XX=`awk '/^[ \t]*(class|struct)/ { print $line }' $H| grep -v ";$"| grep -v CLUCENE_EXPORT| grep -v CLUCENE_SHARED_EXPORT` + if [ $t_exports == 1 ]; then + XX=`awk '/^[ \t]*(class|struct)/ { print $line }' $H| grep -v ";$"| grep -v CLUCENE_EXPORT| grep -v CLUCENE_INLINE_EXPORT| grep -v CLUCENE_SHARED_EXPORT| grep -v CLUCENE_SHARED_INLINE_EXPORT` if [ "$XX" != "" ]; then echo "$H has unexported class: $XX" echo "" + FAIL=1 fi fi - #check licenses - if [ $t_license == 1 ]; then - if [ "`awk '/Copyright \(C\) 2003-2006 Ben van Klinken and the CLucene Team/ { print $line }' $H`" == "" ]; then - echo "$H has invalid license" - fi - fi - #test that each header compiles independently... if [ $t_c_h == 1 ]; then - echo "Compiling $H" echo "#include \"CLucene/StdHeader.h"\" >$TMP/pub-header.cpp echo "#include \"$H"\" >>$TMP/pub-header.cpp echo "int main(){return 0;}" >>$TMP/pub-header.cpp g++ -I. -I$TMP/src/shared -I$TMP/src/core $TMP/pub-header.cpp - if [ $? != 0 ]; then exit 1; fi + if [ $? != 0 ]; then + FAIL=1; + fi fi done fi +#iterate all our code... +if [ $t_license == 1 ]; then + for H in `find ../src`; do + BH=`basename "$H"` + BH_len=${#BH} + + if [ "${BH:BH_len-2}" == ".h" ] || [ "${BH:BH_len-2}" == ".c" ] || [ "${BH:BH_len-4}" == ".cpp" ]; then + if [ "`awk '/\* Copyright \(C\) [0-9]*-[0-9]* .*$/ { print $line }' $H`" == "" ]; then + echo "$H has invalid license" + FAIL=1 + fi + fi + done + +fi + + #test if headers can compile together by themselves: if [ $t_c_all == 1 ]; then g++ -I$TMP/src -I$TMP/src/shared -I$TMP/src/core $TMP/pub-headers.cpp fi -#find inline code: if [ $t_inline == 1 ]; then - if [ $t_env == 1 ]; then - make DoxygenDoc - fi - echo "These documentation files report inline code. This is not good." - grep -c "\[inline" doc/html/*.html|grep -v ":0$"|grep -v "util"|grep -v "jstreams" | nl + INLINES=0 + grep -c "\[inline" doc/html/*.html|grep -v ":0$"|grep -v "util"|grep -v "jstreams" | while read line; do + + #ignore some actual inlines... + if [ "doc/html/classlucene_1_1index_1_1Term.html:1" == $line ]; then + continue; + fi + + if [ $INLINES == 0 ]; then + echo "These files report inline code:" + INLINES=1 + FAIL=1 + fi + echo $line + done fi -if [ $t_t_all == 1 ]; then - #test pedantically +if [ $t_compile == 1 ]; then + #compile serperately + make cl_test + if [ $? != 0 ]; then + FAIL=1; + fi + + #compile together make test-all + if [ $? != 0 ]; then + FAIL=1; + fi fi + + +if [ $FAIL == 1 ]; then + echo "There were errors, please correct them and re-run" + exit 1 +fi +exit 0 Modified: branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -89,10 +89,34 @@ setText(text); } +size_t Token::bufferLength(){ + return bufferTextLen; +} + + +int32_t Token::startOffset() const { + return _startOffset; +} + +void Token::setStartOffset(const int32_t val){ + _startOffset = val; +} +int32_t Token::endOffset() const { + return _endOffset; +} const TCHAR* Token::getDefaultType(){ return _T("word"); } +void Token::setEndOffset(const int32_t val){ + _endOffset = val; +} +const TCHAR* Token::type() const { return _type; } + +void Token::setType(const TCHAR* val) { + _type = val; +} + void Token::set(const TCHAR* text, const int32_t start, const int32_t end, const TCHAR* typ){ _startOffset = start; _endOffset = end; @@ -208,7 +232,10 @@ return t; } +TokenStream::~TokenStream(){ +} + TokenFilter::TokenFilter(TokenStream* in, bool deleteTS): input(in), deleteTokenStream(deleteTS) Modified: branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -8,6 +8,7 @@ #define _lucene_analysis_AnalysisHeader_ #include "CLucene/index/Payload.h" +#include "CLucene/util/VoidMapSetDefinitions.h" CL_CLASS_DEF(util,Reader) CL_NS_DEF(analysis) @@ -80,7 +81,7 @@ Token(const TCHAR* text, const int32_t start, const int32_t end, const TCHAR* typ=NULL); void set(const TCHAR* text, const int32_t start, const int32_t end, const TCHAR* typ=NULL); - size_t bufferLength(){ return bufferTextLen; } + size_t bufferLength(); void growBuffer(size_t size); /** Set the position increment. This determines the position of this @@ -132,25 +133,25 @@ * equal to termText.length(), as the term text may have been altered by a * stemmer or some other filter. */ - int32_t startOffset() const { return _startOffset; } + int32_t startOffset() const; /** Set the starting offset. @see #startOffset() */ - void setStartOffset(const int32_t val){ _startOffset = val; } + void setStartOffset(const int32_t val); /** * Returns this Token's ending offset, one greater than the position of the * last character corresponding to this token in the source text. */ - int32_t endOffset() const { return _endOffset; } + int32_t endOffset() const; /** Set the ending offset. @see #endOffset() */ - void setEndOffset(const int32_t val){ _endOffset = val; } + void setEndOffset(const int32_t val); /// Returns this Token's lexical type. Defaults to "word". - const TCHAR* type() const { return _type; } ///<returns reference - void setType(const TCHAR* val) { _type = val; } ///<returns reference + const TCHAR* type() const; ///<returns reference + void setType(const TCHAR* val); ///<returns reference /** * Returns this Token's payload. @@ -206,8 +207,7 @@ */ //virtual void reset(CL_NS(util)::Reader* _input=NULL) = 0; - virtual ~TokenStream(){ - } + virtual ~TokenStream(); }; Modified: branches/lucene2_3_2/src/core/CLucene/index/DocumentWriter.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/DocumentWriter.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/index/DocumentWriter.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -17,6 +17,7 @@ #include "IndexWriter.h" #include "_FieldsWriter.h" #include "Term.h" +#include "_Term.h" #include "_TermInfo.h" #include "_TermVector.h" #include "_TermInfosWriter.h" Modified: branches/lucene2_3_2/src/core/CLucene/index/IndexReader.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/IndexReader.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/index/IndexReader.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -367,6 +367,13 @@ return _termPositions; } + void IndexReader::deleteDoc(const int32_t docNum){ + deleteDocument(docNum); + } + int32_t IndexReader::deleteTerm(Term* term){ + return deleteDocuments(term); + } + void IndexReader::deleteDocument(const int32_t docNum) { //Func - Deletes the document numbered docNum. Once a document is deleted it will not appear // in TermDocs or TermPostitions enumerations. Attempts to read its field with the document Modified: branches/lucene2_3_2/src/core/CLucene/index/IndexReader.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/IndexReader.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/index/IndexReader.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -389,7 +389,7 @@ void deleteDocument(const int32_t docNum); ///@deprecated. Use deleteDocument instead. - _CL_DEPRECATED( deleteDocument ) void deleteDoc(const int32_t docNum){ deleteDocument(docNum); } + _CL_DEPRECATED( deleteDocument ) void deleteDoc(const int32_t docNum); /** Deletes all documents containing <code>term</code>. * This is useful if one uses a document field to hold a unique ID string for @@ -403,7 +403,7 @@ int32_t deleteDocuments(Term* term); ///@deprecated. Use deleteDocuments instead. - _CL_DEPRECATED( deleteDocuments ) int32_t deleteTerm(Term* term){ return deleteDocuments(term); } + _CL_DEPRECATED( deleteDocuments ) int32_t deleteTerm(Term* term); /** * Closes files associated with this index and also saves any new deletions to disk. Modified: branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -729,5 +729,29 @@ // delete now unused files of segment writer->deleteFiles(*filesToDelete); } + + + int32_t IndexWriter::getMaxFieldLength() const{ return maxFieldLength; } + void IndexWriter::setMaxFieldLength(int32_t val){ maxFieldLength = val; } + void IndexWriter::setMaxBufferedDocs(int32_t val){ minMergeDocs = val; } + int32_t IndexWriter::getMaxBufferedDocs(){ return minMergeDocs; } + void IndexWriter::setWriteLockTimeout(int64_t writeLockTimeout) { this->writeLockTimeout = writeLockTimeout; } + int64_t IndexWriter::getWriteLockTimeout() { return writeLockTimeout; } + void IndexWriter::setCommitLockTimeout(int64_t commitLockTimeout) { this->commitLockTimeout = commitLockTimeout; } + int64_t IndexWriter::getCommitLockTimeout() { return commitLockTimeout; } + int32_t IndexWriter::getMergeFactor() const{ return mergeFactor; } + void IndexWriter::setMergeFactor(int32_t val){ mergeFactor = val; } + void IndexWriter::setTermIndexInterval(int32_t interval) { termIndexInterval = interval; } + int32_t IndexWriter::getTermIndexInterval() { return termIndexInterval; } + int32_t IndexWriter::getMinMergeDocs() const{ return minMergeDocs; } + void IndexWriter::setMinMergeDocs(int32_t val){ minMergeDocs = val; } + int32_t IndexWriter::getMaxMergeDocs() const{ return maxMergeDocs; } + void IndexWriter::setMaxMergeDocs(int32_t val){ maxMergeDocs = val; } + CL_NS(store)::Directory* IndexWriter::getDirectory() { return directory; } + bool IndexWriter::getUseCompoundFile() { return useCompoundFile; } + void IndexWriter::setUseCompoundFile(bool value) { useCompoundFile = value; } + void IndexWriter::setSimilarity(CL_NS(search)::Similarity* similarity) { this->similarity = similarity; } + CL_NS(search)::Similarity* IndexWriter::getSimilarity() { return this->similarity; } + CL_NS(analysis)::Analyzer* IndexWriter::getAnalyzer() { return analyzer; } CL_NS_END Modified: branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -112,8 +112,8 @@ */ LUCENE_STATIC_CONSTANT(int32_t, DEFAULT_MAX_FIELD_LENGTH = 10000); LUCENE_STATIC_CONSTANT(int32_t, FIELD_TRUNC_POLICY__WARN = -1); - int32_t getMaxFieldLength() const{ return maxFieldLength; } - void setMaxFieldLength(int32_t val){ maxFieldLength = val; } + int32_t getMaxFieldLength() const; + void setMaxFieldLength(int32_t val); /** * Default value is 10. Change using {@link #setMaxBufferedDocs(int)}. @@ -126,11 +126,11 @@ * the number of files open in a FSDirectory. * * <p> The default value is DEFAULT_MAX_BUFFERED_DOCS.*/ - void setMaxBufferedDocs(int32_t val){ minMergeDocs = val; } + void setMaxBufferedDocs(int32_t val); /** * @see #setMaxBufferedDocs */ - int32_t getMaxBufferedDocs(){ return minMergeDocs; } + int32_t getMaxBufferedDocs(); /** * Default value for the write lock timeout (1,000). @@ -139,11 +139,11 @@ /** * Sets the maximum time to wait for a write lock (in milliseconds). */ - void setWriteLockTimeout(int64_t writeLockTimeout) { this->writeLockTimeout = writeLockTimeout; } + void setWriteLockTimeout(int64_t writeLockTimeout); /** * @see #setWriteLockTimeout */ - int64_t getWriteLockTimeout() { return writeLockTimeout; } + int64_t getWriteLockTimeout(); /** * Default value for the commit lock timeout (10,000). @@ -152,11 +152,11 @@ /** * Sets the maximum time to wait for a commit lock (in milliseconds). */ - void setCommitLockTimeout(int64_t commitLockTimeout) { this->commitLockTimeout = commitLockTimeout; } + void setCommitLockTimeout(int64_t commitLockTimeout); /** * @see #setCommitLockTimeout */ - int64_t getCommitLockTimeout() { return commitLockTimeout; } + int64_t getCommitLockTimeout(); static const char* WRITE_LOCK_NAME; //"write.lock"; static const char* COMMIT_LOCK_NAME; //"commit.lock"; @@ -175,8 +175,8 @@ * * <p>This must never be less than 2. The default value is 10. */ - int32_t getMergeFactor() const{ return mergeFactor; } - void setMergeFactor(int32_t val){ mergeFactor = val; } + int32_t getMergeFactor() const; + void setMergeFactor(int32_t val); /** Expert: The fraction of terms in the "dictionary" which should be stored @@ -207,12 +207,12 @@ * * @see #DEFAULT_TERM_INDEX_INTERVAL */ - void setTermIndexInterval(int32_t interval) { termIndexInterval = interval; } + void setTermIndexInterval(int32_t interval); /** Expert: Return the interval between indexed terms. * * @see #setTermIndexInterval(int) */ - int32_t getTermIndexInterval() { return termIndexInterval; } + int32_t getTermIndexInterval(); /** Determines the minimal number of documents required before the buffered * in-memory documents are merging and a new Segment is created. @@ -221,8 +221,8 @@ * the number of files open in a FSDirectory. * * <p> The default value is 10.*/ - int32_t getMinMergeDocs() const{ return minMergeDocs; } - void setMinMergeDocs(int32_t val){ minMergeDocs = val; } + int32_t getMinMergeDocs() const; + void setMinMergeDocs(int32_t val); /** Determines the largest number of documents ever merged by addDocument(). * Small values (e.g., less than 10,000) are best for interactive indexing, @@ -239,8 +239,8 @@ * * <p>The default value is {@link Integer#MAX_VALUE}. */ - int32_t getMaxMergeDocs() const{ return maxMergeDocs; } - void setMaxMergeDocs(int32_t val){ maxMergeDocs = val; } + int32_t getMaxMergeDocs() const; + void setMaxMergeDocs(int32_t val); /** * Constructs an IndexWriter for the index in <code>path</code>. @@ -316,36 +316,36 @@ /** Returns the directory this index resides in. */ - CL_NS(store)::Directory* getDirectory() { return directory; } + CL_NS(store)::Directory* getDirectory(); /** Get the current setting of whether to use the compound file format. * Note that this just returns the value you set with setUseCompoundFile(boolean) * or the default. You cannot use this to query the status of an existing index. * @see #setUseCompoundFile(boolean) */ - bool getUseCompoundFile() { return useCompoundFile; } + bool getUseCompoundFile(); /** Setting to turn on usage of a compound file. When on, multiple files * for each segment are merged into a single file once the segment creation * is finished. This is done regardless of what directory is in use. */ - void setUseCompoundFile(bool value) { useCompoundFile = value; } + void setUseCompoundFile(bool value); /** Expert: Set the Similarity implementation used by this IndexWriter. * * @see Similarity#setDefault(Similarity) */ - void setSimilarity(CL_NS(search)::Similarity* similarity) { this->similarity = similarity; } + void setSimilarity(CL_NS(search)::Similarity* similarity); /** Expert: Return the Similarity implementation used by this IndexWriter. * * <p>This defaults to the current value of {@link Similarity#getDefault()}. */ - CL_NS(search)::Similarity* getSimilarity() { return this->similarity; } + CL_NS(search)::Similarity* getSimilarity(); /** Returns the analyzer used by this index. */ - CL_NS(analysis)::Analyzer* getAnalyzer() { return analyzer; } + CL_NS(analysis)::Analyzer* getAnalyzer(); private: class LockWith2; Modified: branches/lucene2_3_2/src/core/CLucene/index/Term.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/Term.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/index/Term.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -206,6 +206,7 @@ return cachedHashCode; } +size_t Term::textLength() const { return textLen; } int32_t Term::compareTo(const Term* other) const { //Func - Compares two terms, to see if this term belongs before,is equal to or after Modified: branches/lucene2_3_2/src/core/CLucene/index/Term.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/Term.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/index/Term.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -7,12 +7,6 @@ #ifndef _lucene_index_Term_ #define _lucene_index_Term_ - -//#include "CLucene/util/Misc.h" -//#include "CLucene/util/StringIntern.h" -#include "CLucene/util/VoidMapSetDefinitions.h" -# include <functional> - CL_NS_DEF(index) /** @@ -103,7 +97,7 @@ bool equals(const Term* other) const; - size_t textLength() const { return textLen; } + size_t textLength() const; ///Forms the contents of Field and term in some kind of tuple notation ///<field:text> @@ -113,24 +107,5 @@ }; -class Term_Equals:public CL_NS_STD(binary_function)<const Term*,const Term*,bool> -{ -public: - bool operator()( const Term* val1, const Term* val2 ) const{ - return val1->equals(val2); - } -}; - -class Term_Compare:LUCENE_BASE, public CL_NS(util)::Compare::_base //<Term*> -{ -public: - bool operator()( Term* t1, Term* t2 ) const{ - return ( t1->compareTo(t2) < 0 ); - } - size_t operator()( Term* t ) const{ - return t->hashCode(); - } -}; - CL_NS_END #endif Added: branches/lucene2_3_2/src/core/CLucene/index/_Term.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/_Term.h (rev 0) +++ branches/lucene2_3_2/src/core/CLucene/index/_Term.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -0,0 +1,37 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_index_internal_Term_ +#define _lucene_index_internal_Term_ + +#include "CLucene/util/VoidMapSetDefinitions.h" +#include "Term.h" +#include <functional> + +CL_NS_DEF(index) + + +class Term_Equals:public CL_NS_STD(binary_function)<const Term*,const Term*,bool> +{ +public: + bool operator()( const Term* val1, const Term* val2 ) const{ + return val1->equals(val2); + } +}; + +class Term_Compare:LUCENE_BASE, public CL_NS(util)::Compare::_base //<Term*> +{ +public: + bool operator()( Term* t1, Term* t2 ) const{ + return ( t1->compareTo(t2) < 0 ); + } + size_t operator()( Term* t ) const{ + return t->hashCode(); + } +}; + +CL_NS_END +#endif Modified: branches/lucene2_3_2/src/core/CLucene/search/Compare.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/Compare.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/Compare.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -21,14 +21,14 @@ public: ~ScoreDocComparators(); - class Relevance:public ScoreDocComparator { + class CLUCENE_EXPORT Relevance:public ScoreDocComparator { public: int32_t compare (struct ScoreDoc* i, struct ScoreDoc* j); CL_NS(util)::Comparable* sortValue (struct ScoreDoc* i); int32_t sortType(); }; - class IndexOrder:public ScoreDocComparator{ + class CLUCENE_EXPORT IndexOrder:public ScoreDocComparator{ public: IndexOrder(); int32_t compare (struct ScoreDoc* i, struct ScoreDoc* j); @@ -37,7 +37,7 @@ }; - class String: public ScoreDocComparator { + class CLUCENE_EXPORT String: public ScoreDocComparator { FieldCache::StringIndex* index; int32_t length; public: @@ -48,7 +48,7 @@ int32_t sortType(); }; - class Int32:public ScoreDocComparator{ + class CLUCENE_EXPORT Int32:public ScoreDocComparator{ int32_t* fieldOrder; int32_t length; public: @@ -58,7 +58,7 @@ int32_t sortType(); }; - class Float:public ScoreDocComparator { + class CLUCENE_EXPORT Float:public ScoreDocComparator { float_t* fieldOrder; int32_t length; public: Modified: branches/lucene2_3_2/src/core/CLucene/search/Hits.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/Hits.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/Hits.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -13,7 +13,7 @@ //#include "Filter.h" CL_CLASS_DEF(document,Document) //#include "Sort.h" -//#include "CLucene/util/VoidList.h" +#include "CLucene/util/VoidMapSetDefinitions.h" //#include "Explanation.h" //#include "Similarity.h" Modified: branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -15,6 +15,7 @@ #include "Searchable.h" #include "Explanation.h" +#include "CLucene/index/_Term.h" #include "CLucene/index/Term.h" #include "CLucene/index/Terms.h" #include "CLucene/index/IndexReader.h" Modified: branches/lucene2_3_2/src/core/CLucene/search/ScorerDocQueue.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/ScorerDocQueue.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/ScorerDocQueue.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -1,3 +1,9 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ #ifndef _lucene_util_ScorerDocQueue_ #define _lucene_util_ScorerDocQueue_ Modified: branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -188,6 +188,10 @@ return _T("Searcher"); } + +Weight::~Weight(){ +} + TCHAR* Weight::toString(){ return STRDUP_TtoT(_T("Weight")); } Modified: branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -106,8 +106,7 @@ */ class CLUCENE_EXPORT Weight: LUCENE_BASE { public: - virtual ~Weight(){ - }; + virtual ~Weight(); /** The query that this concerns. */ virtual Query* getQuery() = 0; Modified: branches/lucene2_3_2/src/core/CLucene/search/Sort.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/Sort.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/Sort.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -92,6 +92,19 @@ return _CLNEW SortField(*this); } + const TCHAR* SortField::getField() const { + return field; + } + int32_t SortField::getType() const { + return type; + } + bool SortField::getReverse() const { + return reverse; + } + SortComparatorSource* SortField::getFactory() const { + return factory; + } + /** Creates a sort by terms in the given field sorted * according to the given locale. * @param field Name of field to sort by, cannot be <code>null</code>. Modified: branches/lucene2_3_2/src/core/CLucene/search/Sort.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/Sort.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/Sort.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -236,14 +236,14 @@ * if the sort is by SCORE or DOC. * @return Name of field, possibly <code>null</code>. */ - const TCHAR* getField() const { return field; } + const TCHAR* getField() const; SortField* clone() const; /** Returns the type of contents in the field. * @return One of the constants SCORE, DOC, AUTO, STRING, INT or FLOAT. */ - int32_t getType() const { return type; } + int32_t getType() const; /** Returns the Locale by which term values are interpreted. * May return <code>null</code> if no Locale was specified. @@ -256,9 +256,9 @@ /** Returns whether the sort should be reversed. * @return True if natural order should be reversed. */ - bool getReverse() const { return reverse; } + bool getReverse() const; - SortComparatorSource* getFactory() const { return factory; } + SortComparatorSource* getFactory() const; TCHAR* toString() const; }; Modified: branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -74,6 +74,8 @@ bool WildcardTermEnum::endEnum() { return _endEnum; } + const char* WildcardTermEnum::getObjectName(){ return WildcardTermEnum::getClassName(); } + const char* WildcardTermEnum::getClassName(){ return "WildcardTermEnum"; } bool WildcardTermEnum::wildcardEquals(const TCHAR* pattern, int32_t patternLen, int32_t patternIdx, const TCHAR* str, int32_t strLen, int32_t stringIdx) { @@ -149,4 +151,5 @@ } } + CL_NS_END Modified: branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -58,8 +58,8 @@ void close(); - const char* getObjectName(){ return WildcardTermEnum::getClassName(); } - static const char* getClassName(){ return "WildcardTermEnum"; } + const char* getObjectName(); + static const char* getClassName(); }; CL_NS_END #endif Modified: branches/lucene2_3_2/src/core/CLucene/store/Directory.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/Directory.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/store/Directory.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -6,12 +6,15 @@ ------------------------------------------------------------------------------*/ #include "CLucene/_ApiHeader.h" -#include "Directory.h" -#include "LockFactory.h" +#include "Directory.h" +#include "LockFactory.h" #include "CLucene/util/Misc.h" CL_NS_DEF(store) + +Directory::Directory(){ +} Directory::~Directory(){ } Modified: branches/lucene2_3_2/src/core/CLucene/store/Directory.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/Directory.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/store/Directory.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -36,8 +36,7 @@ protected: LockFactory* lockFactory; - Directory(){ - } + Directory(); // Removes an existing file in the directory. virtual bool doDeleteFile(const char* name) = 0; public: Modified: branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -403,7 +403,16 @@ _CLDELETE_CaARRAY(directory); _CLDELETE_CaARRAY(lockDir); } + + void FSDirectory::setUseMMap(bool value){ useMMap = value; } + bool FSDirectory::getUseMMap() const{ return useMMap; } + const char* FSDirectory::DirectoryType(){ return "FS"; } + const char* FSDirectory::getDirectoryType() const{ return "FS"; } + void FSDirectory::setDisableLocks(bool doDisableLocks) { disableLocks = doDisableLocks; } + bool FSDirectory::getDisableLocks() { return disableLocks; } + + void FSDirectory::list(vector<string>* names) const{ //todo: fix this, ugly!!! CND_PRECONDITION(directory[0]!=0,"directory is not open"); DIR* dir = opendir(directory); Modified: branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -123,29 +123,29 @@ * If MMap is available, this can disable use of * mmap reading. */ - void setUseMMap(bool value){ useMMap = value; } + void setUseMMap(bool value); /** * Gets whether the directory is using MMap for inputstreams. */ - bool getUseMMap() const{ return useMMap; } + bool getUseMMap() const; TCHAR* toString() const; - static const char* DirectoryType(){ return "FS"; } - const char* getDirectoryType() const{ return "FS"; } + static const char* DirectoryType(); + const char* getDirectoryType() const; /** * Set whether Lucene's use of lock files is disabled. By default, * lock files are enabled. They should only be disabled if the index * is on a read-only medium like a CD-ROM. */ - static void setDisableLocks(bool doDisableLocks) { disableLocks = doDisableLocks; } + static void setDisableLocks(bool doDisableLocks); /** * Returns whether Lucene's use of lock files is disabled. * @return true if locks are disabled, false if locks are enabled. */ - static bool getDisableLocks() { return disableLocks; } + static bool getDisableLocks(); }; Modified: branches/lucene2_3_2/src/core/CLucene/store/IndexInput.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/IndexInput.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/store/IndexInput.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -14,6 +14,9 @@ IndexInput::IndexInput() { } + IndexInput::~IndexInput() + { + } IndexInput::IndexInput(const IndexInput& other) { } Modified: branches/lucene2_3_2/src/core/CLucene/store/IndexInput.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/IndexInput.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/store/IndexInput.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -25,7 +25,7 @@ IndexInput(); IndexInput(const IndexInput& clone); public: - virtual ~IndexInput(){} + virtual ~IndexInput(); virtual IndexInput* clone() const =0; DEFINE_MUTEX(THIS_LOCK) Modified: branches/lucene2_3_2/src/core/CLucene/util/Equators.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/Equators.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/util/Equators.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -19,35 +19,35 @@ // Equators //////////////////////////////////////////////////////////////////////////////// /** @internal */ -class Equals{ +class CLUCENE_INLINE_EXPORT Equals{ public: - class Int32:public CL_NS_STD(binary_function)<const int32_t*,const int32_t*,bool> + class CLUCENE_INLINE_EXPORT Int32:public CL_NS_STD(binary_function)<const int32_t*,const int32_t*,bool> { public: bool operator()( const int32_t val1, const int32_t val2 ) const; }; - class Char:public CL_NS_STD(binary_function)<const char*,const char*,bool> + class CLUCENE_INLINE_EXPORT Char:public CL_NS_STD(binary_function)<const char*,const char*,bool> { public: bool operator()( const char* val1, const char* val2 ) const; }; #ifdef _UCS2 - class WChar: public CL_NS_STD(binary_function)<const wchar_t*,const wchar_t*,bool> + class CLUCENE_INLINE_EXPORT WChar: public CL_NS_STD(binary_function)<const wchar_t*,const wchar_t*,bool> { public: bool operator()( const wchar_t* val1, const wchar_t* val2 ) const; }; - class TChar: public WChar{ + class CLUCENE_INLINE_EXPORT TChar: public WChar{ }; #else - class TChar: public Char{ + class CLUCENE_INLINE_EXPORT TChar: public Char{ }; #endif template<typename _cl> - class Void:public CL_NS_STD(binary_function)<const void*,const void*,bool> + class CLUCENE_INLINE_EXPORT Void:public CL_NS_STD(binary_function)<const void*,const void*,bool> { public: bool operator()( _cl* val1, _cl* val2 ) const{ @@ -61,7 +61,7 @@ // Comparors //////////////////////////////////////////////////////////////////////////////// /** @internal */ -class Comparable:LUCENE_BASE{ +class CLUCENE_INLINE_EXPORT Comparable:LUCENE_BASE{ public: virtual ~Comparable(){ } @@ -70,9 +70,9 @@ }; /** @internal */ -class Compare{ +class CLUCENE_INLINE_EXPORT Compare{ public: - class _base + class CLUCENE_INLINE_EXPORT _base { // traits class for hash containers public: enum @@ -86,7 +86,7 @@ } }; - class Int32:public _base, public Comparable{ + class CLUCENE_INLINE_EXPORT Int32:public _base, public Comparable{ int32_t value; public: int32_t getValue() const; @@ -98,7 +98,7 @@ }; - class Float:public Comparable{ + class CLUCENE_INLINE_EXPORT Float:public Comparable{ float_t value; public: float_t getValue() const; @@ -107,7 +107,7 @@ }; - class Char: public _base //<char*> + class CLUCENE_INLINE_EXPORT Char: public _base //<char*> { public: bool operator()( const char* val1, const char* val2 ) const; @@ -115,7 +115,7 @@ }; #ifdef _UCS2 - class WChar: public _base //<wchar_t*> + class CLUCENE_INLINE_EXPORT WChar: public _base //<wchar_t*> { public: bool operator()( const wchar_t* val1, const wchar_t* val2 ) const; @@ -123,7 +123,7 @@ }; #endif - class TChar: public _base, public Comparable{ + class CLUCENE_INLINE_EXPORT TChar: public _base, public Comparable{ const TCHAR* s; public: const TCHAR* getValue() const; @@ -136,7 +136,7 @@ template<typename _cl> - class Void:public _base //<const void*,const void*,bool> + class CLUCENE_INLINE_EXPORT Void:public _base //<const void*,const void*,bool> { public: int32_t compareTo(_cl* o){ @@ -158,14 +158,14 @@ // allocators //////////////////////////////////////////////////////////////////////////////// /** @internal */ -class AbstractDeletor{ +class CLUCENE_INLINE_EXPORT AbstractDeletor{ public: virtual void Delete(void*) = 0; virtual ~AbstractDeletor(); }; -class Deletor{ +class CLUCENE_INLINE_EXPORT Deletor{ public: - class tcArray: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT tcArray: public AbstractDeletor{ public: void Delete(void* _arr){ doDelete((const TCHAR*)_arr); @@ -176,7 +176,7 @@ }; template<typename _kt> - class vArray: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT vArray: public AbstractDeletor{ public: void Delete(void* arr){ doDelete((_kt*)arr); @@ -185,7 +185,7 @@ _CLDELETE_LARRAY(arr); } }; - class acArray: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT acArray: public AbstractDeletor{ public: void Delete(void* arr){ doDelete((const char*)arr); @@ -196,7 +196,7 @@ }; template<typename _kt> - class Object: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT Object: public AbstractDeletor{ public: void Delete(void* obj){ doDelete((_kt*)obj); @@ -206,7 +206,7 @@ } }; template<typename _kt> - class Void: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT Void: public AbstractDeletor{ public: void Delete(void* obj){ doDelete((_kt*)obj); @@ -215,7 +215,7 @@ _CLVDELETE(obj); } }; - class Dummy: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT Dummy: public AbstractDeletor{ public: void Delete(void* nothing){} static void doDelete(const void* nothing){ @@ -223,20 +223,20 @@ //CND_WARNING(false,"Deletor::Dummy::doDelete run, set deleteKey or deleteValue to false"); } }; - class DummyInt32: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT DummyInt32: public AbstractDeletor{ public: void Delete(void* nothing){} static void doDelete(const int32_t nothing){ } }; - class DummyFloat: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT DummyFloat: public AbstractDeletor{ public: void Delete(void* nothing){} static void doDelete(const float_t nothing){ } }; template <typename _type> - class ConstNullVal: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT ConstNullVal: public AbstractDeletor{ public: void Delete(void* nothing){} static void doDelete(const _type nothing){ @@ -246,7 +246,7 @@ }; template <typename _type> - class NullVal: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT NullVal: public AbstractDeletor{ public: void Delete(void* nothing){} static void doDelete(_type nothing){ Modified: branches/lucene2_3_2/src/core/CLucene/util/PriorityQueue.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/PriorityQueue.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/util/PriorityQueue.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -13,7 +13,7 @@ least element can always be found in constant time. Put()'s and pop()'s require log(size) time. */ template <class _type,typename _valueDeletor> -class PriorityQueue:LUCENE_BASE { +class CLUCENE_INLINE_EXPORT PriorityQueue:LUCENE_BASE { private: size_t _size; bool dk; Modified: branches/lucene2_3_2/src/core/CLucene/util/Reader.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/Reader.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/util/Reader.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -107,7 +107,7 @@ StringReader ( const TCHAR* value ); StringReader ( const TCHAR* value, const int32_t length ); StringReader ( const TCHAR* value, const int32_t length, bool copyData ); - ~StringReader(); + virtual ~StringReader(); }; /** A very simple inputstreamreader implementation. For a @@ -130,7 +130,7 @@ int32_t fillBuffer(TCHAR* start, int32_t space); public: SimpleInputStreamReader(jstreams::StreamBase<char> *i, const char* encoding); - ~SimpleInputStreamReader(); + virtual ~SimpleInputStreamReader(); }; /** @@ -143,7 +143,7 @@ FileReader ( const char* path, const char* enc, const int32_t cachelen = 13, const int32_t cachebuff = 14 ); //todo: optimise these cache values - ~FileReader (); + virtual ~FileReader (); int32_t read(const TCHAR*& start, int32_t _min, int32_t _max); int64_t mark(int32_t readlimit); Modified: branches/lucene2_3_2/src/core/CLucene/util/VoidList.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/VoidList.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/util/VoidList.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -7,11 +7,8 @@ #ifndef _lucene_util_VoidList_ #define _lucene_util_VoidList_ -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - #include "Equators.h" +#include "CLucene/LuceneThreads.h" CL_NS_DEF(util) @@ -20,7 +17,7 @@ * @internal */ template<typename _kt,typename _base,typename _valueDeletor> -class __CLList:public _base,LUCENE_BASE { +class CLUCENE_INLINE_EXPORT __CLList:public _base,LUCENE_BASE { private: bool dv; typedef _base base; @@ -113,7 +110,7 @@ //a list, so can contain duplicates //it grows in chunks... todo: check jlucene for initial size of array, and growfactors template<typename _kt, typename _valueDeletor=CL_NS(util)::Deletor::Dummy> -class CLVector:public __CLList<_kt, CL_NS_STD(vector)<_kt> , _valueDeletor> +class CLUCENE_INLINE_EXPORT CLVector:public __CLList<_kt, CL_NS_STD(vector)<_kt> , _valueDeletor> { public: CLVector ( const bool deleteValue=true ): @@ -140,7 +137,7 @@ template<typename _kt, typename _Comparator=CL_NS(util)::Compare::TChar, typename _valueDeletor=CL_NS(util)::Deletor::Dummy> -class CLHashList:public __CLList<_kt, CL_NS_HASHING(hash_set)<_kt,_Comparator> , _valueDeletor> +class CLUCENE_INLINE_EXPORT CLHashList:public __CLList<_kt, CL_NS_HASHING(hash_set)<_kt,_Comparator> , _valueDeletor> { public: CLHashList ( const bool deleteValue=true ): @@ -151,7 +148,7 @@ #endif template<typename _kt, typename _valueDeletor=CL_NS(util)::Deletor::Dummy> -class CLLinkedList:public __CLList<_kt, CL_NS_STD(list)<_kt> , _valueDeletor> +class CLUCENE_INLINE_EXPORT CLLinkedList:public __CLList<_kt, CL_NS_STD(list)<_kt> , _valueDeletor> { public: CLLinkedList ( const bool deleteValue=true ): @@ -162,7 +159,7 @@ template<typename _kt, typename _Comparator=CL_NS(util)::Compare::TChar, typename _valueDeletor=CL_NS(util)::Deletor::Dummy> -class CLSetList:public __CLList<_kt, CL_NS_STD(set)<_kt,_Comparator> , _valueDeletor> +class CLUCENE_INLINE_EXPORT CLSetList:public __CLList<_kt, CL_NS_STD(set)<_kt,_Comparator> , _valueDeletor> { public: CLSetList ( const bool deleteValue=true ): Modified: branches/lucene2_3_2/src/core/CLucene/util/VoidMap.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/VoidMap.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/util/VoidMap.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -8,6 +8,7 @@ #define _lucene_util_VoidMap_ #include "Equators.h" +#include "CLucene/LuceneThreads.h" #if defined(_CL_HAVE_HASH_MAP) && defined(_CL_HAVE_HASH_SET) //hashing is all or nothing! @@ -30,7 +31,7 @@ typename _base, typename _KeyDeletor=CL_NS(util)::Deletor::Dummy, typename _ValueDeletor=CL_NS(util)::Deletor::Dummy> -class __CLMap:public _base,LUCENE_BASE { +class CLUCENE_INLINE_EXPORT __CLMap:public _base,LUCENE_BASE { private: bool dk; bool dv; @@ -164,7 +165,7 @@ typename _EqualDummy, typename _KeyDeletor=CL_NS(util)::Deletor::Dummy, typename _ValueDeletor=CL_NS(util)::Deletor::Dummy> -class CLHashMap:public __CLMap<_kt,_vt, +class CLUCENE_INLINE_EXPORT CLHashMap:public __CLMap<_kt,_vt, CL_NS_STD(map)<_kt,_vt, _Compare>, _KeyDeletor,_ValueDeletor> { @@ -186,7 +187,7 @@ typename _Equals, typename _KeyDeletor=CL_NS(util)::Deletor::Dummy, typename _ValueDeletor=CL_NS(util)::Deletor::Dummy> -class CLHashMap:public __CLMap<_kt,_vt, +class CLUCENE_INLINE_EXPORT CLHashMap:public __CLMap<_kt,_vt, CL_NS_HASHING(hash_map)<_kt,_vt, _Hasher,_Equals>, _KeyDeletor,_ValueDeletor> { @@ -208,7 +209,7 @@ typename _Equals, typename _KeyDeletor=CL_NS(util)::Deletor::Dummy, typename _ValueDeletor=CL_NS(util)::Deletor::Dummy> -class CLHashMap:public __CLMap<_kt,_vt, +class CLUCENE_INLINE_EXPORT CLHashMap:public __CLMap<_kt,_vt, CL_NS_HASHING(hash_map)<_kt,_vt, _Hasher>, _KeyDeletor,_ValueDeletor> { @@ -229,7 +230,7 @@ typename _Compare, typename _KeyDeletor=CL_NS(util)::Deletor::Dummy, typename _ValueDeletor=CL_NS(util)::Deletor::Dummy> -class CLSet:public __CLMap<_kt,_vt, +class CLUCENE_INLINE_EXPORT CLSet:public __CLMap<_kt,_vt, CL_NS_STD(map)<_kt,_vt, _Compare>, _KeyDeletor,_ValueDeletor> { @@ -250,7 +251,7 @@ typename _Compare, typename _KeyDeletor=CL_NS(util)::Deletor::Dummy, typename _ValueDeletor=CL_NS(util)::Deletor::Dummy> -class CLMultiMap:public __CLMap<_kt,_vt, +class CLUCENE_INLINE_EXPORT CLMultiMap:public __CLMap<_kt,_vt, CL_NS_STD(multimap)<_kt,_vt>, _KeyDeletor,_ValueDeletor> { Modified: branches/lucene2_3_2/src/core/CLucene/util/fileinputstream.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/fileinputstream.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/util/fileinputstream.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -1,17 +1,27 @@ -/** - * Copyright 2003-2006 The Apache Software Foundation +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Jos van den Oever +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +/* This file is part of Strigi Desktop Search * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Copyright (C) 2006 Jos van den Oever <jo...@va...> * - * http://www.apache.org/licenses/LICENSE-2.0 + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef FILEINPUTSTREAM_H #define FILEINPUTSTREAM_H Modified: branches/lucene2_3_2/src/core/CLucene/util/stringreader.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/stringreader.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/util/stringreader.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -37,7 +37,7 @@ namespace jstreams { template <class T> -class StringReader : public StreamBase<T> { +class CLUCENE_INLINE_EXPORT StringReader : public StreamBase<T> { private: int64_t markpt; T* data; Modified: branches/lucene2_3_2/src/core/CLucene/util/subinputstream.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/subinputstream.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/util/subinputstream.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -31,7 +31,7 @@ namespace jstreams { template<class T> -class SubInputStream : public StreamBase<T> { +class CLUCENE_INLINE_EXPORT SubInputStream : public StreamBase<T> { private: const int64_t offset; StreamBase<T> *input; Modified: branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -158,6 +158,17 @@ #ifndef CLUCENE_LOCAL #define CLUCENE_LOCAL #endif + +//inline definitions +#ifdef __MINGW32__ + #define CLUCENE_SHARED_INLINE_EXPORT + #define CLUCENE_INLINE_EXPORT + #define CLUCENE_CONTRIBS_INLINE_EXPORT +#else + #define CLUCENE_SHARED_INLINE_EXPORT CLUCENE_SHARED_EXPORT + #define CLUCENE_INLINE_EXPORT CLUCENE_EXPORT + #define CLUCENE_CONTRIBS_INLINE_EXPORT CLUCENE_CONTRIBS_EXPORT +#endif //////////////////////////////////////////////////////// Modified: branches/lucene2_3_2/src/shared/CLucene/util/dirent.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/util/dirent.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/shared/CLucene/util/dirent.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -10,8 +10,8 @@ #if !defined(_CL_HAVE_DIRENT_H) && !defined(_CL_HAVE_SYS_NDIR_H) && !defined(_CL_HAVE_SYS_DIR_H) && !defined(_CL_HAVE_NDIR_H) -#ifdef _WIN64 - typedef __int64 intptr_t; +#ifdef _WIN64 + typedef __int64 intptr_t; #else typedef int intptr_t; #endif @@ -33,14 +33,14 @@ */ /** dirent structure - used by the dirent.h directory iteration functions */ -struct dirent +struct CLUCENE_SHARED_INLINE_EXPORT dirent { unsigned short d_namlen; /* Length of name in d_name. */ char *d_name; /* File name. */ }; /** DIR structure - used by the dirent.h directory iteration functions*/ -struct DIR +struct CLUCENE_SHARED_INLINE_EXPORT DIR { /** disk transfer area for this dir */ struct _finddata_t dd_dta; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |