base.h | base.h | |||
---|---|---|---|---|
/** @file base.h | /** @file base.h | |||
* @brief Reference-counted pointers | * @brief Reference-counted pointers | |||
*/ | */ | |||
/* Copyright 1999,2000,2001 BrightStation PLC | /* Copyright 1999,2000,2001 BrightStation PLC | |||
* Copyright 2002 Ananova Ltd | * Copyright 2002 Ananova Ltd | |||
* Copyright 2002,2003,2004,2007 Olly Betts | * Copyright 2002,2003,2004,2007,2014 Olly Betts | |||
* | * | |||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | |||
* published by the Free Software Foundation; either version 2 of the | * published by the Free Software Foundation; either version 2 of the | |||
* License, or (at your option) any later version. | * License, or (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | * GNU General Public License for more details. | |||
skipping to change at line 120 | skipping to change at line 120 | |||
template <class T> | template <class T> | |||
inline void RefCntPtr<T>::operator=(const RefCntPtr &other) { | inline void RefCntPtr<T>::operator=(const RefCntPtr &other) { | |||
operator=(other.dest); | operator=(other.dest); | |||
} | } | |||
template <class T> | template <class T> | |||
inline void RefCntPtr<T>::operator=(T *dest_) { | inline void RefCntPtr<T>::operator=(T *dest_) { | |||
// copy the new dest in before we delete the old to avoid a small | // copy the new dest in before we delete the old to avoid a small | |||
// window in which dest points to a deleted object | // window in which dest points to a deleted object | |||
// FIXME: if pointer assignment isn't atomic, we ought to use locking.. . | ||||
T *old_dest = dest; | T *old_dest = dest; | |||
dest = dest_; | dest = dest_; | |||
// Increment the new before we decrement the old so that if dest == des t_ | // Increment the new before we decrement the old so that if dest == des t_ | |||
// we don't delete the pointer. | // we don't delete the pointer. | |||
// | // | |||
// Note that if dest == dest_, either both are NULL (in which case we | // Note that if dest == dest_, either both are NULL (in which case we | |||
// aren't reference counting), or we're already reference counting the | // aren't reference counting), or we're already reference counting the | |||
// object, in which case ref_count is non-zero at this point. So we | // object, in which case ref_count is non-zero at this point. So we | |||
// won't accidentally delete an untracked object by doing this. | // won't accidentally delete an untracked object by doing this. | |||
if (dest) ++dest->ref_count; | if (dest) ++dest->ref_count; | |||
if (old_dest && --old_dest->ref_count == 0) delete old_dest; | if (old_dest && --old_dest->ref_count == 0) delete old_dest; | |||
} | } | |||
template <class T> | template <class T> | |||
inline RefCntPtr<T>::~RefCntPtr() | inline RefCntPtr<T>::~RefCntPtr() | |||
{ | { | |||
if (dest && --dest->ref_count == 0) { | if (dest && --dest->ref_count == 0) { | |||
// zero before we delete to avoid a small window in which dest point s | // zero before we delete to avoid a small window in which dest point s | |||
// to a deleted object | // to a deleted object | |||
// FIXME: if pointer assignment isn't atomic, we ought to use lockin g... | ||||
T * condemned = dest; | T * condemned = dest; | |||
dest = 0; | dest = 0; | |||
delete condemned; | delete condemned; | |||
} | } | |||
} | } | |||
template <class T> | template <class T> | |||
template <class U> | template <class U> | |||
inline | inline | |||
RefCntPtr<T>::RefCntPtr(const RefCntPtr<U> &other) | RefCntPtr<T>::RefCntPtr(const RefCntPtr<U> &other) | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 1 lines changed or added | |||
error.h | error.h | |||
---|---|---|---|---|
/** @file error.h | /** @file error.h | |||
* @brief Hierarchy of classes which Xapian can throw as exceptions. | * @brief Hierarchy of classes which Xapian can throw as exceptions. | |||
*/ | */ | |||
/* Warning: This file is generated by /data/home/olly/tmp/xapian-svn-snapsh ot/tags/1.2.17/xapian/xapian-core/generate-exceptions - do not modify direc tly! */ | /* Warning: This file is generated by /data/home/olly/tmp/xapian-svn-snapsh ot/tags/1.2.18/xapian/xapian-core/generate-exceptions - do not modify direc tly! */ | |||
/* Copyright (C) 2003,2004,2006,2007,2009 Olly Betts | /* Copyright (C) 2003,2004,2006,2007,2009 Olly Betts | |||
* | * | |||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | |||
* published by the Free Software Foundation; either version 2 of the | * published by the Free Software Foundation; either version 2 of the | |||
* License, or (at your option) any later version. | * License, or (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
queryparser.h | queryparser.h | |||
---|---|---|---|---|
/** \file queryparser.h | /** \file queryparser.h | |||
* \brief parsing a user query string to build a Xapian::Query object | * \brief parsing a user query string to build a Xapian::Query object | |||
*/ | */ | |||
/* Copyright (C) 2005,2006,2007,2008,2009,2010,2011 Olly Betts | /* Copyright (C) 2005,2006,2007,2008,2009,2010,2011,2014 Olly Betts | |||
* Copyright (C) 2010 Adam Sjøgren | * Copyright (C) 2010 Adam Sjøgren | |||
* | * | |||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | |||
* published by the Free Software Foundation; either version 2 of the | * published by the Free Software Foundation; either version 2 of the | |||
* License, or (at your option) any later version. | * License, or (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
skipping to change at line 63 | skipping to change at line 63 | |||
}; | }; | |||
/// Simple implementation of Stopper class - this will suit most users. | /// Simple implementation of Stopper class - this will suit most users. | |||
class XAPIAN_VISIBILITY_DEFAULT SimpleStopper : public Stopper { | class XAPIAN_VISIBILITY_DEFAULT SimpleStopper : public Stopper { | |||
std::set<std::string> stop_words; | std::set<std::string> stop_words; | |||
public: | public: | |||
/// Default constructor. | /// Default constructor. | |||
SimpleStopper() { } | SimpleStopper() { } | |||
/// Initialise from a pair of iterators. | /** Initialise from a pair of iterators. | |||
* | ||||
* Xapian includes stop list files for many languages. You can initiali | ||||
se from a file like that: | ||||
* @code | ||||
* ifstream inFile ("stopwords/english/stop.txt"); | ||||
* Xapian::SimplerStopper stopper(istream_iterator<string>(inFile), ist | ||||
ream_iterator<string>()); | ||||
* @endcode | ||||
* | ||||
*/ | ||||
#if ! defined __SUNPRO_CC || __SUNPRO_CC - 0 >= 0x580 | #if ! defined __SUNPRO_CC || __SUNPRO_CC - 0 >= 0x580 | |||
template <class Iterator> | template <class Iterator> | |||
SimpleStopper(Iterator begin, Iterator end) : stop_words(begin, end) { } | SimpleStopper(Iterator begin, Iterator end) : stop_words(begin, end) { } | |||
#else | #else | |||
// Older versions of Sun's C++ compiler don't cope with the Iterator | // Older versions of Sun's C++ compiler don't cope with the Iterator | |||
// pointing to const char *. | // pointing to const char *. | |||
template <class Iterator> | template <class Iterator> | |||
SimpleStopper(Iterator begin, Iterator end) { | SimpleStopper(Iterator begin, Iterator end) { | |||
while (begin != end) stop_words.insert(*begin++); | while (begin != end) stop_words.insert(*begin++); | |||
} | } | |||
skipping to change at line 500 | skipping to change at line 508 | |||
/** Set the stemming strategy. | /** Set the stemming strategy. | |||
* | * | |||
* This controls how the query parser will apply the stemming algorith m. | * This controls how the query parser will apply the stemming algorith m. | |||
* Note that the stemming algorithm is only applied to words in | * Note that the stemming algorithm is only applied to words in | |||
* probabilistic fields - boolean filter terms are never stemmed. | * probabilistic fields - boolean filter terms are never stemmed. | |||
* | * | |||
* @param strategy The strategy to use - possible values are: | * @param strategy The strategy to use - possible values are: | |||
* - STEM_NONE: Don't perform any stemming. (default in Xapian <= | * - STEM_NONE: Don't perform any stemming. (default in Xapian <= | |||
* 1.3.0) | * 1.3.0) | |||
* - STEM_SOME: Search for stemmed forms of terms except for those | * - STEM_SOME: Stem all terms except for those which start with a | |||
* which start with a capital letter, or are followed b | * capital letter, or are followed by certain character | |||
y | s | |||
* certain characters (currently: (/\@<>=*[{" ), or are | * (currently: <code>(/\@<>=*[{"</code> ), or are used | |||
* used with operators which need positional informatio | * with operators which need positional information. | |||
n. | ||||
* Stemmed terms are prefixed with 'Z'. (default in | * Stemmed terms are prefixed with 'Z'. (default in | |||
* Xapian >= 1.3.1) | * Xapian >= 1.3.1) | |||
* - STEM_ALL: Search for stemmed forms of all words (note: no 'Z' | * - STEM_ALL: Stem all terms (note: no 'Z' prefix is added). | |||
* prefix is added). | * - STEM_ALL_Z: Stem all terms (note: 'Z' prefix is added). (new in | |||
* - STEM_ALL_Z: Search for stemmed forms of all words (note: 'Z' | * Xapian 1.2.11 and 1.3.1) | |||
* prefix is added). (new in Xapian 1.2.11 and 1.3.1) | ||||
*/ | */ | |||
void set_stemming_strategy(stem_strategy strategy); | void set_stemming_strategy(stem_strategy strategy); | |||
/** Set the stopper. | /** Set the stopper. | |||
* | * | |||
* @param stop The Stopper object to set (default NULL, which means no | * @param stop The Stopper object to set (default NULL, which means no | |||
* stopwords). | * stopwords). | |||
*/ | */ | |||
void set_stopper(const Stopper *stop = NULL); | void set_stopper(const Stopper *stop = NULL); | |||
End of changes. 4 change blocks. | ||||
12 lines changed or deleted | 20 lines changed or added | |||
version.h | version.h | |||
---|---|---|---|---|
skipping to change at line 46 | skipping to change at line 46 | |||
#error was not compiled with this flag. The settings must match or your | #error was not compiled with this flag. The settings must match or your | |||
#error program will not work correctly. | #error program will not work correctly. | |||
#endif | #endif | |||
#endif | #endif | |||
#endif | #endif | |||
/// The library was compiled with GCC's -fvisibility=hidden option. | /// The library was compiled with GCC's -fvisibility=hidden option. | |||
#define XAPIAN_ENABLE_VISIBILITY | #define XAPIAN_ENABLE_VISIBILITY | |||
/// The version of Xapian as a C string literal. | /// The version of Xapian as a C string literal. | |||
#define XAPIAN_VERSION "1.2.17" | #define XAPIAN_VERSION "1.2.18" | |||
/** The major component of the Xapian version. | /** The major component of the Xapian version. | |||
* E.g. for Xapian 1.0.14 this would be: 1 | * E.g. for Xapian 1.0.14 this would be: 1 | |||
*/ | */ | |||
#define XAPIAN_MAJOR_VERSION 1 | #define XAPIAN_MAJOR_VERSION 1 | |||
/** The minor component of the Xapian version. | /** The minor component of the Xapian version. | |||
* E.g. for Xapian 1.0.14 this would be: 0 | * E.g. for Xapian 1.0.14 this would be: 0 | |||
*/ | */ | |||
#define XAPIAN_MINOR_VERSION 2 | #define XAPIAN_MINOR_VERSION 2 | |||
/** The revision component of the Xapian version. | /** The revision component of the Xapian version. | |||
* E.g. for Xapian 1.0.14 this would be: 14 | * E.g. for Xapian 1.0.14 this would be: 14 | |||
*/ | */ | |||
#define XAPIAN_REVISION 17 | #define XAPIAN_REVISION 18 | |||
/// XAPIAN_HAS_BRASS_BACKEND Defined if the brass backend is enabled. | /// XAPIAN_HAS_BRASS_BACKEND Defined if the brass backend is enabled. | |||
#define XAPIAN_HAS_BRASS_BACKEND 1 | #define XAPIAN_HAS_BRASS_BACKEND 1 | |||
/// XAPIAN_HAS_CHERT_BACKEND Defined if the chert backend is enabled. | /// XAPIAN_HAS_CHERT_BACKEND Defined if the chert backend is enabled. | |||
#define XAPIAN_HAS_CHERT_BACKEND 1 | #define XAPIAN_HAS_CHERT_BACKEND 1 | |||
/// XAPIAN_HAS_FLINT_BACKEND Defined if the flint backend is enabled. | /// XAPIAN_HAS_FLINT_BACKEND Defined if the flint backend is enabled. | |||
#define XAPIAN_HAS_FLINT_BACKEND 1 | #define XAPIAN_HAS_FLINT_BACKEND 1 | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||