got rid of the STD_SHARED_XX std/tr1 defines

This commit is contained in:
Jean-Francois Dockes 2016-07-13 15:12:25 +02:00
parent eb6465a619
commit c1d06dd450
65 changed files with 219 additions and 257 deletions

View file

@ -1,10 +1,3 @@
#define UNORDERED_MAP_INCLUDE <unordered_map>
#define UNORDERED_SET_INCLUDE <unordered_set>
#define STD_UNORDERED_MAP std::unordered_map
#define STD_UNORDERED_SET std::unordered_set
#define MEMORY_INCLUDE <memory>
#define STD_SHARED_PTR std::shared_ptr
#ifdef _WIN32 #ifdef _WIN32
#include "safewindows.h" #include "safewindows.h"

View file

@ -23,7 +23,7 @@
#include <set> #include <set>
#include <utility> #include <utility>
#include <map> #include <map>
#include UNORDERED_SET_INCLUDE #include <unordered_set>
using std::string; using std::string;
using std::vector; using std::vector;
@ -378,10 +378,10 @@ class RclConfig {
static string o_localecharset; static string o_localecharset;
// Limiting set of mime types to be processed. Normally empty. // Limiting set of mime types to be processed. Normally empty.
ParamStale m_rmtstate; ParamStale m_rmtstate;
STD_UNORDERED_SET<string> m_restrictMTypes; std::unordered_set<string> m_restrictMTypes;
// Exclusion set of mime types. Normally empty // Exclusion set of mime types. Normally empty
ParamStale m_xmtstate; ParamStale m_xmtstate;
STD_UNORDERED_SET<string> m_excludeMTypes; std::unordered_set<string> m_excludeMTypes;
vector<pair<int, int> > m_thrConf; vector<pair<int, int> > m_thrConf;

View file

@ -23,7 +23,7 @@
#include "smallut.h" #include "smallut.h"
#include <errno.h> #include <errno.h>
#include UNORDERED_MAP_INCLUDE #include <unordered_map>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <cstring> #include <cstring>
@ -46,7 +46,7 @@ public:
} }
bool ok; bool ok;
// Term to group num // Term to group num
STD_UNORDERED_MAP<string, unsigned int> terms; std::unordered_map<string, unsigned int> terms;
// Group num to group // Group num to group
vector<vector<string> > groups; vector<vector<string> > groups;
}; };
@ -170,7 +170,7 @@ vector<string> SynGroups::getgroup(const string& term)
if (!ok()) if (!ok())
return ret; return ret;
STD_UNORDERED_MAP<string, unsigned int>::const_iterator it1 = std::unordered_map<string, unsigned int>::const_iterator it1 =
m->terms.find(term); m->terms.find(term);
if (it1 == m->terms.end()) { if (it1 == m->terms.end()) {
LOGDEB1("SynGroups::getgroup: [" << (term) << "] not found in direct map\n" ); LOGDEB1("SynGroups::getgroup: [" << (term) << "] not found in direct map\n" );

View file

@ -24,7 +24,7 @@
#include <string> #include <string>
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include UNORDERED_SET_INCLUDE #include <unordered_set>
#include "textsplit.h" #include "textsplit.h"
#include "log.h" #include "log.h"
@ -62,9 +62,9 @@ static int charclasses[charclasses_size];
// management of Unicode properties, but seems to do the job well // management of Unicode properties, but seems to do the job well
// enough in most common cases // enough in most common cases
static vector<unsigned int> vpuncblocks; static vector<unsigned int> vpuncblocks;
static STD_UNORDERED_SET<unsigned int> spunc; static std::unordered_set<unsigned int> spunc;
static STD_UNORDERED_SET<unsigned int> visiblewhite; static std::unordered_set<unsigned int> visiblewhite;
static STD_UNORDERED_SET<unsigned int> sskip; static std::unordered_set<unsigned int> sskip;
class CharClassInit { class CharClassInit {
public: public:

View file

@ -18,7 +18,7 @@
#ifndef TEST_SUBTREELIST #ifndef TEST_SUBTREELIST
#include "autoconfig.h" #include "autoconfig.h"
#include MEMORY_INCLUDE #include <memory>
#include "cstr.h" #include "cstr.h"
#include "rcldb.h" #include "rcldb.h"
@ -38,7 +38,7 @@ bool subtreelist(RclConfig *config, const string& top,
} }
Rcl::SearchData *sd = new Rcl::SearchData(Rcl::SCLT_OR, cstr_null); Rcl::SearchData *sd = new Rcl::SearchData(Rcl::SCLT_OR, cstr_null);
STD_SHARED_PTR<Rcl::SearchData> rq(sd); std::shared_ptr<Rcl::SearchData> rq(sd);
sd->addClause(new Rcl::SearchDataClausePath(top, false)); sd->addClause(new Rcl::SearchDataClausePath(top, false));

View file

@ -332,8 +332,8 @@ bool RecollProtocol::doSearch(const QueryDesc& qd)
return false; return false;
} }
STD_SHARED_PTR<Rcl::SearchData> sdata(sd); std::shared_ptr<Rcl::SearchData> sdata(sd);
STD_SHARED_PTR<Rcl::Query>query(new Rcl::Query(m_rcldb)); std::shared_ptr<Rcl::Query>query(new Rcl::Query(m_rcldb));
query->setCollapseDuplicates(prefs.collapseDuplicates); query->setCollapseDuplicates(prefs.collapseDuplicates);
if (!query->setQuery(sdata)) { if (!query->setQuery(sdata)) {
m_reason = "Query execute failed. Invalid query or syntax error?"; m_reason = "Query execute failed. Invalid query or syntax error?";
@ -342,12 +342,12 @@ bool RecollProtocol::doSearch(const QueryDesc& qd)
} }
DocSequenceDb *src = DocSequenceDb *src =
new DocSequenceDb(STD_SHARED_PTR<Rcl::Query>(query), "Query results", sdata); new DocSequenceDb(std::shared_ptr<Rcl::Query>(query), "Query results", sdata);
if (src == 0) { if (src == 0) {
error(KIO::ERR_SLAVE_DEFINED, "Can't build result sequence"); error(KIO::ERR_SLAVE_DEFINED, "Can't build result sequence");
return false; return false;
} }
m_source = STD_SHARED_PTR<DocSequence>(src); m_source = std::shared_ptr<DocSequence>(src);
// Reset pager in all cases. Costs nothing, stays at page -1 initially // Reset pager in all cases. Costs nothing, stays at page -1 initially
// htmldosearch will fetch the first page if needed. // htmldosearch will fetch the first page if needed.
m_pager.setDocSource(m_source); m_pager.setDocSource(m_source);

View file

@ -32,7 +32,7 @@ using std::string;
#include "rcldb.h" #include "rcldb.h"
#include "reslistpager.h" #include "reslistpager.h"
#include "docseq.h" #include "docseq.h"
#include MEMORY_INCLUDE #include <memory>
class RecollProtocol; class RecollProtocol;
@ -181,7 +181,7 @@ class RecollProtocol : public KIO::SlaveBase {
// (one slave several konqueror windows) would be to have a small // (one slave several konqueror windows) would be to have a small
// cache of recent searches kept open. // cache of recent searches kept open.
RecollKioPager m_pager; RecollKioPager m_pager;
STD_SHARED_PTR<DocSequence> m_source; std::shared_ptr<DocSequence> m_source;
// Note: page here is not used, current page always comes from m_pager. // Note: page here is not used, current page always comes from m_pager.
QueryDesc m_query; QueryDesc m_query;
}; };

View file

@ -336,8 +336,8 @@ bool RecollProtocol::doSearch(const QueryDesc& qd)
return false; return false;
} }
STD_SHARED_PTR<Rcl::SearchData> sdata(sd); std::shared_ptr<Rcl::SearchData> sdata(sd);
STD_SHARED_PTR<Rcl::Query>query(new Rcl::Query(m_rcldb)); std::shared_ptr<Rcl::Query>query(new Rcl::Query(m_rcldb));
query->setCollapseDuplicates(prefs.collapseDuplicates); query->setCollapseDuplicates(prefs.collapseDuplicates);
if (!query->setQuery(sdata)) { if (!query->setQuery(sdata)) {
m_reason = "Query execute failed. Invalid query or syntax error?"; m_reason = "Query execute failed. Invalid query or syntax error?";
@ -346,12 +346,12 @@ bool RecollProtocol::doSearch(const QueryDesc& qd)
} }
DocSequenceDb *src = DocSequenceDb *src =
new DocSequenceDb(STD_SHARED_PTR<Rcl::Query>(query), "Query results", sdata); new DocSequenceDb(std::shared_ptr<Rcl::Query>(query), "Query results", sdata);
if (src == 0) { if (src == 0) {
error(KIO::ERR_SLAVE_DEFINED, u8s2qs("Can't build result sequence")); error(KIO::ERR_SLAVE_DEFINED, u8s2qs("Can't build result sequence"));
return false; return false;
} }
m_source = STD_SHARED_PTR<DocSequence>(src); m_source = std::shared_ptr<DocSequence>(src);
// Reset pager in all cases. Costs nothing, stays at page -1 initially // Reset pager in all cases. Costs nothing, stays at page -1 initially
// htmldosearch will fetch the first page if needed. // htmldosearch will fetch the first page if needed.
m_pager.setDocSource(m_source); m_pager.setDocSource(m_source);

View file

@ -28,7 +28,7 @@
#include "rcldb.h" #include "rcldb.h"
#include "docseq.h" #include "docseq.h"
#include "reslistpager.h" #include "reslistpager.h"
#include MEMORY_INCLUDE #include <memory>
class RecollProtocol; class RecollProtocol;
@ -191,7 +191,7 @@ private:
// (one slave several konqueror windows) would be to have a small // (one slave several konqueror windows) would be to have a small
// cache of recent searches kept open. // cache of recent searches kept open.
RecollKioPager m_pager; RecollKioPager m_pager;
STD_SHARED_PTR<DocSequence> m_source; std::shared_ptr<DocSequence> m_source;
// Note: page here is not used, current page always comes from m_pager. // Note: page here is not used, current page always comes from m_pager.
QueryDesc m_query; QueryDesc m_query;
}; };

View file

@ -131,7 +131,7 @@ PHP_METHOD(Query, query)
RETURN_BOOL(false); RETURN_BOOL(false);
} }
STD_SHARED_PTR<Rcl::SearchData> rq(sd); std::shared_ptr<Rcl::SearchData> rq(sd);
Rcl::Query *pRclQuery = new Rcl::Query(pRclDb); Rcl::Query *pRclQuery = new Rcl::Query(pRclDb);
pRclQuery->setQuery(rq); pRclQuery->setQuery(rq);

View file

@ -56,7 +56,7 @@ static RclConfig *rclconfig;
typedef struct { typedef struct {
PyObject_HEAD PyObject_HEAD
/* Type-specific fields go here. */ /* Type-specific fields go here. */
STD_SHARED_PTR<Rcl::SearchData> sd; std::shared_ptr<Rcl::SearchData> sd;
} recoll_SearchDataObject; } recoll_SearchDataObject;
static void static void
@ -108,7 +108,7 @@ SearchData_init(recoll_SearchDataObject *self, PyObject *args, PyObject *kwargs)
} else { } else {
stemlang = "english"; stemlang = "english";
} }
self->sd = STD_SHARED_PTR<Rcl::SearchData>(new Rcl::SearchData(tp, stemlang)); self->sd = std::shared_ptr<Rcl::SearchData>(new Rcl::SearchData(tp, stemlang));
return 0; return 0;
} }
@ -953,7 +953,7 @@ Query_execute(recoll_QueryObject* self, PyObject *args, PyObject *kwargs)
return 0; return 0;
} }
STD_SHARED_PTR<Rcl::SearchData> rq(sd); std::shared_ptr<Rcl::SearchData> rq(sd);
self->query->setSortBy(*self->sortfield, self->ascending); self->query->setSortBy(*self->sortfield, self->ascending);
self->query->setQuery(rq); self->query->setQuery(rq);
int cnt = self->query->getResCnt(); int cnt = self->query->getResCnt();
@ -1221,7 +1221,7 @@ Query_highlight(recoll_QueryObject* self, PyObject *args, PyObject *kwargs)
return 0; return 0;
} }
STD_SHARED_PTR<Rcl::SearchData> sd = self->query->getSD(); std::shared_ptr<Rcl::SearchData> sd = self->query->getSD();
if (!sd) { if (!sd) {
PyErr_SetString(PyExc_ValueError, "Query not initialized"); PyErr_SetString(PyExc_ValueError, "Query not initialized");
return 0; return 0;
@ -1272,7 +1272,7 @@ Query_makedocabstract(recoll_QueryObject* self, PyObject *args,PyObject *kwargs)
PyErr_SetString(PyExc_AttributeError, "query"); PyErr_SetString(PyExc_AttributeError, "query");
return 0; return 0;
} }
STD_SHARED_PTR<Rcl::SearchData> sd = self->query->getSD(); std::shared_ptr<Rcl::SearchData> sd = self->query->getSD();
if (!sd) { if (!sd) {
PyErr_SetString(PyExc_ValueError, "Query not initialized"); PyErr_SetString(PyExc_ValueError, "Query not initialized");
return 0; return 0;
@ -1328,7 +1328,7 @@ Query_getxquery(recoll_QueryObject* self, PyObject *, PyObject *)
PyErr_SetString(PyExc_AttributeError, "query"); PyErr_SetString(PyExc_AttributeError, "query");
return 0; return 0;
} }
STD_SHARED_PTR<Rcl::SearchData> sd = self->query->getSD(); std::shared_ptr<Rcl::SearchData> sd = self->query->getSD();
if (!sd) { if (!sd) {
PyErr_SetString(PyExc_ValueError, "Query not initialized"); PyErr_SetString(PyExc_ValueError, "Query not initialized");
return 0; return 0;
@ -1356,7 +1356,7 @@ Query_getgroups(recoll_QueryObject* self, PyObject *, PyObject *)
PyErr_SetString(PyExc_AttributeError, "query"); PyErr_SetString(PyExc_AttributeError, "query");
return 0; return 0;
} }
STD_SHARED_PTR<Rcl::SearchData> sd = self->query->getSD(); std::shared_ptr<Rcl::SearchData> sd = self->query->getSD();
if (!sd) { if (!sd) {
PyErr_SetString(PyExc_ValueError, "Query not initialized"); PyErr_SetString(PyExc_ValueError, "Query not initialized");
return 0; return 0;

View file

@ -360,7 +360,7 @@ using namespace Rcl;
void AdvSearch::runSearch() void AdvSearch::runSearch()
{ {
string stemLang = prefs.stemlang(); string stemLang = prefs.stemlang();
STD_SHARED_PTR<SearchData> sdata(new SearchData(conjunctCMB->currentIndex() == 0 ? std::shared_ptr<SearchData> sdata(new SearchData(conjunctCMB->currentIndex() == 0 ?
SCLT_AND : SCLT_OR, stemLang)); SCLT_AND : SCLT_OR, stemLang));
bool hasclause = false; bool hasclause = false;
@ -427,7 +427,7 @@ void AdvSearch::runSearch()
if (sdata->getTp() == SCLT_AND) { if (sdata->getTp() == SCLT_AND) {
sdata->addClause(pathclause); sdata->addClause(pathclause);
} else { } else {
STD_SHARED_PTR<SearchData> std::shared_ptr<SearchData>
nsdata(new SearchData(SCLT_AND, stemLang)); nsdata(new SearchData(SCLT_AND, stemLang));
nsdata->addClause(new Rcl::SearchDataClauseSub(sdata)); nsdata->addClause(new Rcl::SearchDataClauseSub(sdata));
nsdata->addClause(pathclause); nsdata->addClause(pathclause);
@ -462,7 +462,7 @@ void AdvSearch::runSearch()
// Set up fields from existing search data, which must be compatible // Set up fields from existing search data, which must be compatible
// with what we can do... // with what we can do...
void AdvSearch::fromSearch(STD_SHARED_PTR<SearchData> sdata) void AdvSearch::fromSearch(std::shared_ptr<SearchData> sdata)
{ {
if (sdata->m_tp == SCLT_OR) if (sdata->m_tp == SCLT_OR)
conjunctCMB->setCurrentIndex(1); conjunctCMB->setCurrentIndex(1);
@ -560,7 +560,7 @@ void AdvSearch::slotHistoryNext()
{ {
if (g_advshistory == 0) if (g_advshistory == 0)
return; return;
STD_SHARED_PTR<Rcl::SearchData> sd = g_advshistory->getnewer(); std::shared_ptr<Rcl::SearchData> sd = g_advshistory->getnewer();
if (!sd) if (!sd)
return; return;
fromSearch(sd); fromSearch(sd);
@ -570,7 +570,7 @@ void AdvSearch::slotHistoryPrev()
{ {
if (g_advshistory == 0) if (g_advshistory == 0)
return; return;
STD_SHARED_PTR<Rcl::SearchData> sd = g_advshistory->getolder(); std::shared_ptr<Rcl::SearchData> sd = g_advshistory->getolder();
if (!sd) if (!sd)
return; return;
fromSearch(sd); fromSearch(sd);

View file

@ -25,7 +25,7 @@
#include "searchclause_w.h" #include "searchclause_w.h"
#include "recoll.h" #include "recoll.h"
#include MEMORY_INCLUDE #include <memory>
#include "searchdata.h" #include "searchdata.h"
#include "advshist.h" #include "advshist.h"
@ -56,7 +56,7 @@ public slots:
virtual void restrictFtCB_toggled(bool); virtual void restrictFtCB_toggled(bool);
virtual void restrictCtCB_toggled(bool); virtual void restrictCtCB_toggled(bool);
virtual void runSearch(); virtual void runSearch();
virtual void fromSearch(STD_SHARED_PTR<Rcl::SearchData> sdata); virtual void fromSearch(std::shared_ptr<Rcl::SearchData> sdata);
virtual void browsePB_clicked(); virtual void browsePB_clicked();
virtual void saveFileTypes(); virtual void saveFileTypes();
virtual void delClause(); virtual void delClause();
@ -66,7 +66,7 @@ public slots:
virtual void slotHistoryPrev(); virtual void slotHistoryPrev();
signals: signals:
void startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool); void startSearch(std::shared_ptr<Rcl::SearchData>, bool);
private: private:
virtual void init(); virtual void init();

View file

@ -33,38 +33,38 @@ AdvSearchHist::AdvSearchHist()
AdvSearchHist::~AdvSearchHist() AdvSearchHist::~AdvSearchHist()
{ {
for (vector<STD_SHARED_PTR<SearchData> >::iterator it = m_entries.begin(); for (vector<std::shared_ptr<SearchData> >::iterator it = m_entries.begin();
it != m_entries.end(); it++) { it != m_entries.end(); it++) {
it->reset(); it->reset();
} }
} }
STD_SHARED_PTR<Rcl::SearchData> AdvSearchHist::getnewest() std::shared_ptr<Rcl::SearchData> AdvSearchHist::getnewest()
{ {
if (m_entries.empty()) if (m_entries.empty())
return STD_SHARED_PTR<Rcl::SearchData>(); return std::shared_ptr<Rcl::SearchData>();
return m_entries[0]; return m_entries[0];
} }
STD_SHARED_PTR<Rcl::SearchData> AdvSearchHist::getolder() std::shared_ptr<Rcl::SearchData> AdvSearchHist::getolder()
{ {
m_current++; m_current++;
if (m_current >= int(m_entries.size())) { if (m_current >= int(m_entries.size())) {
m_current--; m_current--;
return STD_SHARED_PTR<Rcl::SearchData>(); return std::shared_ptr<Rcl::SearchData>();
} }
return m_entries[m_current]; return m_entries[m_current];
} }
STD_SHARED_PTR<Rcl::SearchData> AdvSearchHist::getnewer() std::shared_ptr<Rcl::SearchData> AdvSearchHist::getnewer()
{ {
if (m_current == -1 || m_current == 0 || m_entries.empty()) if (m_current == -1 || m_current == 0 || m_entries.empty())
return STD_SHARED_PTR<Rcl::SearchData>(); return std::shared_ptr<Rcl::SearchData>();
return m_entries[--m_current]; return m_entries[--m_current];
} }
bool AdvSearchHist::push(STD_SHARED_PTR<SearchData> sd) bool AdvSearchHist::push(std::shared_ptr<SearchData> sd)
{ {
m_entries.insert(m_entries.begin(), sd); m_entries.insert(m_entries.begin(), sd);
if (m_current != -1) if (m_current != -1)
@ -83,7 +83,7 @@ bool AdvSearchHist::read()
for (list<string>::const_iterator it = lxml.begin(); it != lxml.end(); for (list<string>::const_iterator it = lxml.begin(); it != lxml.end();
it++) { it++) {
STD_SHARED_PTR<SearchData> sd = xmlToSearchData(*it); std::shared_ptr<SearchData> sd = xmlToSearchData(*it);
if (sd) if (sd)
m_entries.push_back(sd); m_entries.push_back(sd);
} }

View file

@ -21,7 +21,7 @@
#include <vector> #include <vector>
#include "recoll.h" #include "recoll.h"
#include MEMORY_INCLUDE #include <memory>
#include "searchdata.h" #include "searchdata.h"
/** Advanced search history. /** Advanced search history.
@ -44,14 +44,14 @@ public:
~AdvSearchHist(); ~AdvSearchHist();
// Add entry // Add entry
bool push(STD_SHARED_PTR<Rcl::SearchData>); bool push(std::shared_ptr<Rcl::SearchData>);
// Get latest. does not change state // Get latest. does not change state
STD_SHARED_PTR<Rcl::SearchData> getnewest(); std::shared_ptr<Rcl::SearchData> getnewest();
// Cursor // Cursor
STD_SHARED_PTR<Rcl::SearchData> getolder(); std::shared_ptr<Rcl::SearchData> getolder();
STD_SHARED_PTR<Rcl::SearchData> getnewer(); std::shared_ptr<Rcl::SearchData> getnewer();
void clear(); void clear();
@ -59,7 +59,7 @@ private:
bool read(); bool read();
int m_current; int m_current;
std::vector<STD_SHARED_PTR<Rcl::SearchData> > m_entries; std::vector<std::shared_ptr<Rcl::SearchData> > m_entries;
}; };
#endif // _ADVSHIST_H_INCLUDED_ #endif // _ADVSHIST_H_INCLUDED_

View file

@ -46,7 +46,7 @@
#include <qstring.h> #include <qstring.h>
#include <qwidget.h> #include <qwidget.h>
#include MEMORY_INCLUDE #include <memory>
class QHBoxLayout; class QHBoxLayout;
class QLineEdit; class QLineEdit;
@ -65,7 +65,7 @@ namespace confgui {
virtual bool set(const std::string& val) = 0; virtual bool set(const std::string& val) = 0;
virtual bool get(std::string& val) = 0; virtual bool get(std::string& val) = 0;
}; };
typedef STD_SHARED_PTR<ConfLinkRep> ConfLink; typedef std::shared_ptr<ConfLinkRep> ConfLink;
// Useful to store/manage data which has no direct representation in // Useful to store/manage data which has no direct representation in
// the config, ie list of subkey directories // the config, ie list of subkey directories

View file

@ -156,7 +156,7 @@ QString PlainToRichQtPreview::curAnchorName() const
ToRichThread::ToRichThread(const string &i, const HighlightData& hd, ToRichThread::ToRichThread(const string &i, const HighlightData& hd,
STD_SHARED_PTR<PlainToRichQtPreview> ptr, std::shared_ptr<PlainToRichQtPreview> ptr,
QStringList& qrichlist, QStringList& qrichlist,
QObject *parent) QObject *parent)
: QThread(parent), m_input(i), m_hdata(hd), m_ptr(ptr), m_output(qrichlist) : QThread(parent), m_input(i), m_hdata(hd), m_ptr(ptr), m_output(qrichlist)

View file

@ -21,7 +21,7 @@
#include <map> #include <map>
#include <string> #include <string>
#include <vector> #include <vector>
#include MEMORY_INCLUDE #include <memory>
#include <QThread> #include <QThread>
#include <QStringList> #include <QStringList>
@ -58,7 +58,7 @@ class ToRichThread : public QThread {
public: public:
ToRichThread(const string &i, const HighlightData& hd, ToRichThread(const string &i, const HighlightData& hd,
STD_SHARED_PTR<PlainToRichQtPreview> ptr, std::shared_ptr<PlainToRichQtPreview> ptr,
QStringList& qrichlst, // Output QStringList& qrichlst, // Output
QObject *parent = 0); QObject *parent = 0);
virtual void run(); virtual void run();
@ -66,7 +66,7 @@ public:
private: private:
const string &m_input; const string &m_input;
const HighlightData &m_hdata; const HighlightData &m_hdata;
STD_SHARED_PTR<PlainToRichQtPreview> m_ptr; std::shared_ptr<PlainToRichQtPreview> m_ptr;
QStringList &m_output; QStringList &m_output;
}; };

View file

@ -26,7 +26,7 @@
#include <stdio.h> #include <stdio.h>
#include MEMORY_INCLUDE #include <memory>
#include <QComboBox> #include <QComboBox>
#include <qvariant.h> #include <qvariant.h>
@ -73,7 +73,7 @@ protected:
private: private:
Preview *m_preview; Preview *m_preview;
STD_SHARED_PTR<PlainToRichQtPreview> m_plaintorich; std::shared_ptr<PlainToRichQtPreview> m_plaintorich;
bool m_dspflds; bool m_dspflds;
string m_url; // filename for this tab string m_url; // filename for this tab

View file

@ -57,7 +57,7 @@ void RclMain::saveLastQuery()
xml = sSearch->asXML(); xml = sSearch->asXML();
} else { } else {
if (g_advshistory) { if (g_advshistory) {
STD_SHARED_PTR<Rcl::SearchData> sd; std::shared_ptr<Rcl::SearchData> sd;
sd = g_advshistory->getnewest(); sd = g_advshistory->getnewest();
if (sd) { if (sd) {
xml = sd->asXML(); xml = sd->asXML();
@ -116,7 +116,7 @@ void RclMain::loadSavedQuery()
} }
// Try to parse as SearchData // Try to parse as SearchData
STD_SHARED_PTR<SearchData> sd = xmlToSearchData(xml); std::shared_ptr<SearchData> sd = xmlToSearchData(xml);
if (sd) { if (sd) {
showAdvSearchDialog(); showAdvSearchDialog();
asearchform->fromSearch(sd); asearchform->fromSearch(sd);

View file

@ -66,9 +66,9 @@ void RclMain::viewUrl()
// StartNativeViewer needs a db source to call getEnclosing() on. // StartNativeViewer needs a db source to call getEnclosing() on.
Rcl::Query *query = new Rcl::Query(rcldb); Rcl::Query *query = new Rcl::Query(rcldb);
DocSequenceDb *src = DocSequenceDb *src =
new DocSequenceDb(STD_SHARED_PTR<Rcl::Query>(query), "", new DocSequenceDb(std::shared_ptr<Rcl::Query>(query), "",
STD_SHARED_PTR<Rcl::SearchData>(new Rcl::SearchData)); std::shared_ptr<Rcl::SearchData>(new Rcl::SearchData));
m_source = STD_SHARED_PTR<DocSequence>(src); m_source = std::shared_ptr<DocSequence>(src);
// Start a native viewer if the mimetype has one defined, else a // Start a native viewer if the mimetype has one defined, else a

View file

@ -49,8 +49,8 @@ void RclMain::showAdvSearchDialog()
this, SLOT (fileExit())); this, SLOT (fileExit()));
connect(asearchform, connect(asearchform,
SIGNAL(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)), SIGNAL(startSearch(std::shared_ptr<Rcl::SearchData>, bool)),
this, SLOT(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool))); this, SLOT(startSearch(std::shared_ptr<Rcl::SearchData>, bool)));
asearchform->show(); asearchform->show();
} else { } else {
// Close and reopen, in hope that makes us visible... // Close and reopen, in hope that makes us visible...

View file

@ -17,7 +17,7 @@
#include "autoconfig.h" #include "autoconfig.h"
#include <utility> #include <utility>
#include MEMORY_INCLUDE #include <memory>
#include <stdlib.h> #include <stdlib.h>
#include <qapplication.h> #include <qapplication.h>
@ -68,20 +68,6 @@
#include "rclhelp.h" #include "rclhelp.h"
#include "moc_rclmain_w.cpp" #include "moc_rclmain_w.cpp"
/* Qt5 moc expands macros when defining signals. The SIGNAL() macro is
a stringification, so it does not expand macros. We have signals
where one of the types is a #define (for the variations on
std::shared_ptr). In qt5, the connection does not work because the
signal string is different between the definition and the connect
call, because of the different macro expansion. We have to use
another level of macro in Qt5 to force macro expansion, but not in
Qt4, so we both define the XSIGNAL and XSLOT macros here, and have
ifdefs in the code. What a mess... */
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
#define XSIGNAL(X) SIGNAL(X)
#define XSLOT(X) SLOT(X)
#endif
using std::pair; using std::pair;
QString g_stringAllStem, g_stringNoStem; QString g_stringAllStem, g_stringNoStem;
@ -307,15 +293,9 @@ void RclMain::init()
connect(&m_watcher, SIGNAL(fileChanged(QString)), connect(&m_watcher, SIGNAL(fileChanged(QString)),
this, SLOT(updateIdxStatus())); this, SLOT(updateIdxStatus()));
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
connect(sSearch, connect(sSearch,
XSIGNAL(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)), SIGNAL(startSearch(std::shared_ptr<Rcl::SearchData>, bool)),
this, XSLOT(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool))); this, SLOT(startSearch(std::shared_ptr<Rcl::SearchData>, bool)));
#else
connect(sSearch,
SIGNAL(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)),
this, SLOT(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)));
#endif
connect(sSearch, SIGNAL(clearSearch()), connect(sSearch, SIGNAL(clearSearch()),
this, SLOT(resetSearch())); this, SLOT(resetSearch()));
connect(preferencesMenu, SIGNAL(triggered(QAction*)), connect(preferencesMenu, SIGNAL(triggered(QAction*)),
@ -383,14 +363,8 @@ void RclMain::init()
restable->setRclMain(this, true); restable->setRclMain(this, true);
connect(actionSaveResultsAsCSV, SIGNAL(triggered()), connect(actionSaveResultsAsCSV, SIGNAL(triggered()),
restable, SLOT(saveAsCSV())); restable, SLOT(saveAsCSV()));
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) connect(this, SIGNAL(docSourceChanged(std::shared_ptr<DocSequence>)),
connect(this, XSIGNAL(docSourceChanged(STD_SHARED_PTR<DocSequence>)), restable, SLOT(setDocSource(std::shared_ptr<DocSequence>)));
restable, XSLOT(setDocSource(STD_SHARED_PTR<DocSequence>)));
#else
connect(this, SIGNAL(docSourceChanged(STD_SHARED_PTR<DocSequence>)),
restable, SLOT(setDocSource(STD_SHARED_PTR<DocSequence>)));
#endif
connect(this, SIGNAL(searchReset()), connect(this, SIGNAL(searchReset()),
restable, SLOT(resetSource())); restable, SLOT(resetSource()));
connect(this, SIGNAL(resultsReady()), connect(this, SIGNAL(resultsReady()),
@ -419,13 +393,8 @@ void RclMain::init()
this, SLOT(showSnippets(Rcl::Doc))); this, SLOT(showSnippets(Rcl::Doc)));
reslist->setRclMain(this, true); reslist->setRclMain(this, true);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) connect(this, SIGNAL(docSourceChanged(std::shared_ptr<DocSequence>)),
connect(this, XSIGNAL(docSourceChanged(STD_SHARED_PTR<DocSequence>)), reslist, SLOT(setDocSource(std::shared_ptr<DocSequence>)));
reslist, XSLOT(setDocSource(STD_SHARED_PTR<DocSequence>)));
#else
connect(this, SIGNAL(docSourceChanged(STD_SHARED_PTR<DocSequence>)),
reslist, SLOT(setDocSource(STD_SHARED_PTR<DocSequence>)));
#endif
connect(firstPageAction, SIGNAL(triggered()), connect(firstPageAction, SIGNAL(triggered()),
reslist, SLOT(resultPageFirst())); reslist, SLOT(resultPageFirst()));
connect(prevPageAction, SIGNAL(triggered()), connect(prevPageAction, SIGNAL(triggered()),
@ -694,7 +663,7 @@ void RclMain::fileExit()
} }
// Start a db query and set the reslist docsource // Start a db query and set the reslist docsource
void RclMain::startSearch(STD_SHARED_PTR<Rcl::SearchData> sdata, bool issimple) void RclMain::startSearch(std::shared_ptr<Rcl::SearchData> sdata, bool issimple)
{ {
LOGDEB("RclMain::startSearch. Indexing " << (m_idxproc?"on":"off") << " Active " << (m_queryActive) << "\n" ); LOGDEB("RclMain::startSearch. Indexing " << (m_idxproc?"on":"off") << " Active " << (m_queryActive) << "\n" );
if (m_queryActive) { if (m_queryActive) {
@ -703,7 +672,7 @@ void RclMain::startSearch(STD_SHARED_PTR<Rcl::SearchData> sdata, bool issimple)
} }
m_queryActive = true; m_queryActive = true;
restable->setEnabled(false); restable->setEnabled(false);
m_source = STD_SHARED_PTR<DocSequence>(); m_source = std::shared_ptr<DocSequence>();
m_searchIsSimple = issimple; m_searchIsSimple = issimple;
@ -733,11 +702,11 @@ void RclMain::startSearch(STD_SHARED_PTR<Rcl::SearchData> sdata, bool issimple)
curPreview = 0; curPreview = 0;
DocSequenceDb *src = DocSequenceDb *src =
new DocSequenceDb(STD_SHARED_PTR<Rcl::Query>(query), new DocSequenceDb(std::shared_ptr<Rcl::Query>(query),
string(tr("Query results").toUtf8()), sdata); string(tr("Query results").toUtf8()), sdata);
src->setAbstractParams(prefs.queryBuildAbstract, src->setAbstractParams(prefs.queryBuildAbstract,
prefs.queryReplaceAbstract); prefs.queryReplaceAbstract);
m_source = STD_SHARED_PTR<DocSequence>(src); m_source = std::shared_ptr<DocSequence>(src);
m_source->setSortSpec(m_sortspec); m_source->setSortSpec(m_sortspec);
m_source->setFiltSpec(m_filtspec); m_source->setFiltSpec(m_filtspec);
@ -747,9 +716,9 @@ void RclMain::startSearch(STD_SHARED_PTR<Rcl::SearchData> sdata, bool issimple)
} }
class QueryThread : public QThread { class QueryThread : public QThread {
STD_SHARED_PTR<DocSequence> m_source; std::shared_ptr<DocSequence> m_source;
public: public:
QueryThread(STD_SHARED_PTR<DocSequence> source) QueryThread(std::shared_ptr<DocSequence> source)
: m_source(source) : m_source(source)
{ {
} }
@ -961,8 +930,8 @@ void RclMain::showSubDocs(Rcl::Doc doc)
new DocSequenceDocs(rcldb, docs, new DocSequenceDocs(rcldb, docs,
qs2utf8s(tr("Sub-documents and attachments"))); qs2utf8s(tr("Sub-documents and attachments")));
src->setDescription(qs2utf8s(tr("Sub-documents and attachments"))); src->setDescription(qs2utf8s(tr("Sub-documents and attachments")));
STD_SHARED_PTR<DocSequence> std::shared_ptr<DocSequence>
source(new DocSource(theconfig, STD_SHARED_PTR<DocSequence>(src))); source(new DocSource(theconfig, std::shared_ptr<DocSequence>(src)));
ResTable *res = new ResTable(); ResTable *res = new ResTable();
res->setRclMain(this, false); res->setRclMain(this, false);
@ -1003,7 +972,7 @@ void RclMain::showDocHistory()
{ {
LOGDEB("RclMain::showDocHistory\n" ); LOGDEB("RclMain::showDocHistory\n" );
emit searchReset(); emit searchReset();
m_source = STD_SHARED_PTR<DocSequence>(); m_source = std::shared_ptr<DocSequence>();
curPreview = 0; curPreview = 0;
string reason; string reason;
@ -1012,8 +981,8 @@ void RclMain::showDocHistory()
return; return;
} }
// Construct a bogus SearchData structure // Construct a bogus SearchData structure
STD_SHARED_PTR<Rcl::SearchData>searchdata = std::shared_ptr<Rcl::SearchData>searchdata =
STD_SHARED_PTR<Rcl::SearchData>(new Rcl::SearchData(Rcl::SCLT_AND, cstr_null)); std::shared_ptr<Rcl::SearchData>(new Rcl::SearchData(Rcl::SCLT_AND, cstr_null));
searchdata->setDescription((const char *)tr("History data").toUtf8()); searchdata->setDescription((const char *)tr("History data").toUtf8());
@ -1022,8 +991,8 @@ void RclMain::showDocHistory()
new DocSequenceHistory(rcldb, g_dynconf, new DocSequenceHistory(rcldb, g_dynconf,
string(tr("Document history").toUtf8())); string(tr("Document history").toUtf8()));
src->setDescription((const char *)tr("History data").toUtf8()); src->setDescription((const char *)tr("History data").toUtf8());
DocSource *source = new DocSource(theconfig, STD_SHARED_PTR<DocSequence>(src)); DocSource *source = new DocSource(theconfig, std::shared_ptr<DocSequence>(src));
m_source = STD_SHARED_PTR<DocSequence>(source); m_source = std::shared_ptr<DocSequence>(source);
m_source->setSortSpec(m_sortspec); m_source->setSortSpec(m_sortspec);
m_source->setFiltSpec(m_filtspec); m_source->setFiltSpec(m_filtspec);
emit docSourceChanged(m_source); emit docSourceChanged(m_source);

View file

@ -30,7 +30,7 @@
#include "rcldb.h" #include "rcldb.h"
#include "searchdata.h" #include "searchdata.h"
#include "spell_w.h" #include "spell_w.h"
#include MEMORY_INCLUDE #include <memory>
#include "pathut.h" #include "pathut.h"
#include "guiutils.h" #include "guiutils.h"
@ -123,7 +123,7 @@ public slots:
virtual void toggleIndexing(); virtual void toggleIndexing();
virtual void rebuildIndex(); virtual void rebuildIndex();
virtual void specialIndex(); virtual void specialIndex();
virtual void startSearch(STD_SHARED_PTR<Rcl::SearchData> sdata, virtual void startSearch(std::shared_ptr<Rcl::SearchData> sdata,
bool issimple); bool issimple);
virtual void previewClosed(Preview *w); virtual void previewClosed(Preview *w);
virtual void showAdvSearchDialog(); virtual void showAdvSearchDialog();
@ -189,7 +189,7 @@ private slots:
virtual void updateIdxStatus(); virtual void updateIdxStatus();
virtual void onWebcacheDestroyed(QObject *); virtual void onWebcacheDestroyed(QObject *);
signals: signals:
void docSourceChanged(STD_SHARED_PTR<DocSequence>); void docSourceChanged(std::shared_ptr<DocSequence>);
void stemLangChanged(const QString& lang); void stemLangChanged(const QString& lang);
void sortDataChanged(DocSeqSortSpec); void sortDataChanged(DocSeqSortSpec);
void resultsReady(); void resultsReady();
@ -233,7 +233,7 @@ private:
DocSeqFiltSpec m_filtspec; DocSeqFiltSpec m_filtspec;
bool m_sortspecnochange; bool m_sortspecnochange;
DocSeqSortSpec m_sortspec; DocSeqSortSpec m_sortspec;
STD_SHARED_PTR<DocSequence> m_source; std::shared_ptr<DocSequence> m_source;
IndexerState m_indexerState; IndexerState m_indexerState;
bool m_queryActive; bool m_queryActive;
bool m_firstIndexing; bool m_firstIndexing;

View file

@ -47,7 +47,7 @@
#include "pathut.h" #include "pathut.h"
#include "mimehandler.h" #include "mimehandler.h"
#include "plaintorich.h" #include "plaintorich.h"
#include MEMORY_INCLUDE #include <memory>
#include "internfile.h" #include "internfile.h"
#include "indexer.h" #include "indexer.h"
#include "snippets_w.h" #include "snippets_w.h"
@ -421,10 +421,10 @@ int ResList::newListId()
extern "C" int XFlush(void *); extern "C" int XFlush(void *);
void ResList::setDocSource(STD_SHARED_PTR<DocSequence> nsource) void ResList::setDocSource(std::shared_ptr<DocSequence> nsource)
{ {
LOGDEB("ResList::setDocSource()\n" ); LOGDEB("ResList::setDocSource()\n" );
m_source = STD_SHARED_PTR<DocSequence>(new DocSource(theconfig, nsource)); m_source = std::shared_ptr<DocSequence>(new DocSource(theconfig, nsource));
} }
// A query was executed, or the filtering/sorting parameters changed, // A query was executed, or the filtering/sorting parameters changed,
@ -447,7 +447,7 @@ void ResList::readDocSource()
void ResList::resetList() void ResList::resetList()
{ {
LOGDEB("ResList::resetList()\n" ); LOGDEB("ResList::resetList()\n" );
setDocSource(STD_SHARED_PTR<DocSequence>()); setDocSource(std::shared_ptr<DocSequence>());
resetView(); resetView();
} }
@ -900,7 +900,7 @@ void ResList::linkWasClicked(const QUrl &url)
LOGERR("ResList::linkWasClicked: can't get doc for " << (i) << "\n" ); LOGERR("ResList::linkWasClicked: can't get doc for " << (i) << "\n" );
return; return;
} }
emit editRequested(ResultPopup::getParent(STD_SHARED_PTR<DocSequence>(), emit editRequested(ResultPopup::getParent(std::shared_ptr<DocSequence>(),
doc)); doc));
} }
break; break;

View file

@ -33,7 +33,7 @@
#include "docseq.h" #include "docseq.h"
#include "sortseq.h" #include "sortseq.h"
#include "filtseq.h" #include "filtseq.h"
#include MEMORY_INCLUDE #include <memory>
#include "rcldoc.h" #include "rcldoc.h"
#include "reslistpager.h" #include "reslistpager.h"
@ -66,7 +66,7 @@ class ResList : public RESLIST_PARENTCLASS
void setRclMain(RclMain *m, bool ismain); void setRclMain(RclMain *m, bool ismain);
public slots: public slots:
virtual void setDocSource(STD_SHARED_PTR<DocSequence> nsource); virtual void setDocSource(std::shared_ptr<DocSequence> nsource);
virtual void resetList(); // Erase current list virtual void resetList(); // Erase current list
virtual void resPageUpOrBack(); // Page up pressed virtual void resPageUpOrBack(); // Page up pressed
virtual void resPageDownOrNext(); // Page down pressed virtual void resPageDownOrNext(); // Page down pressed
@ -118,7 +118,7 @@ class ResList : public RESLIST_PARENTCLASS
private: private:
QtGuiResListPager *m_pager; QtGuiResListPager *m_pager;
STD_SHARED_PTR<DocSequence> m_source; std::shared_ptr<DocSequence> m_source;
int m_popDoc; // Docnum for the popup menu. int m_popDoc; // Docnum for the popup menu.
int m_curPvDoc;// Docnum for current preview int m_curPvDoc;// Docnum for current preview
int m_lstClckMod; // Last click modifier. int m_lstClckMod; // Last click modifier.

View file

@ -29,7 +29,7 @@
namespace ResultPopup { namespace ResultPopup {
QMenu *create(QWidget *me, int opts, STD_SHARED_PTR<DocSequence> source, Rcl::Doc& doc) QMenu *create(QWidget *me, int opts, std::shared_ptr<DocSequence> source, Rcl::Doc& doc)
{ {
QMenu *popup = new QMenu(me); QMenu *popup = new QMenu(me);
@ -134,7 +134,7 @@ QMenu *create(QWidget *me, int opts, STD_SHARED_PTR<DocSequence> source, Rcl::Do
return popup; return popup;
} }
Rcl::Doc getParent(STD_SHARED_PTR<DocSequence> source, Rcl::Doc& doc) Rcl::Doc getParent(std::shared_ptr<DocSequence> source, Rcl::Doc& doc)
{ {
Rcl::Doc pdoc; Rcl::Doc pdoc;
if (!source || !source->getEnclosing(doc, pdoc)) { if (!source || !source->getEnclosing(doc, pdoc)) {

View file

@ -22,9 +22,9 @@ namespace ResultPopup {
enum Options {showExpand = 0x1, showSubs = 0x2, isMain = 0x3, enum Options {showExpand = 0x1, showSubs = 0x2, isMain = 0x3,
showSaveOne = 0x4, showSaveSel = 0x8}; showSaveOne = 0x4, showSaveSel = 0x8};
extern QMenu *create(QWidget *me, int opts, extern QMenu *create(QWidget *me, int opts,
STD_SHARED_PTR<DocSequence> source, std::shared_ptr<DocSequence> source,
Rcl::Doc& doc); Rcl::Doc& doc);
extern Rcl::Doc getParent(STD_SHARED_PTR<DocSequence> source, extern Rcl::Doc getParent(std::shared_ptr<DocSequence> source,
Rcl::Doc& doc); Rcl::Doc& doc);
extern void copyFN(const Rcl::Doc &doc); extern void copyFN(const Rcl::Doc &doc);
extern void copyURL(const Rcl::Doc &doc); extern void copyURL(const Rcl::Doc &doc);

View file

@ -35,7 +35,7 @@
#include <QMessageBox> #include <QMessageBox>
#include "recoll.h" #include "recoll.h"
#include MEMORY_INCLUDE #include <memory>
#include "docseq.h" #include "docseq.h"
#include "log.h" #include "log.h"
#include "restable.h" #include "restable.h"
@ -290,13 +290,13 @@ void RecollModel::readDocSource()
endResetModel(); endResetModel();
} }
void RecollModel::setDocSource(STD_SHARED_PTR<DocSequence> nsource) void RecollModel::setDocSource(std::shared_ptr<DocSequence> nsource)
{ {
LOGDEB("RecollModel::setDocSource\n" ); LOGDEB("RecollModel::setDocSource\n" );
if (!nsource) { if (!nsource) {
m_source = STD_SHARED_PTR<DocSequence>(); m_source = std::shared_ptr<DocSequence>();
} else { } else {
m_source = STD_SHARED_PTR<DocSequence>(new DocSource(theconfig, nsource)); m_source = std::shared_ptr<DocSequence>(new DocSource(theconfig, nsource));
m_hdata.clear(); m_hdata.clear();
m_source->getTerms(m_hdata); m_source->getTerms(m_hdata);
} }
@ -661,7 +661,7 @@ void ResTable::takeFocus()
tableView->setFocus(Qt::ShortcutFocusReason); tableView->setFocus(Qt::ShortcutFocusReason);
} }
void ResTable::setDocSource(STD_SHARED_PTR<DocSequence> nsource) void ResTable::setDocSource(std::shared_ptr<DocSequence> nsource)
{ {
LOGDEB("ResTable::setDocSource\n" ); LOGDEB("ResTable::setDocSource\n" );
if (m_model) if (m_model)
@ -676,7 +676,7 @@ void ResTable::setDocSource(STD_SHARED_PTR<DocSequence> nsource)
void ResTable::resetSource() void ResTable::resetSource()
{ {
LOGDEB("ResTable::resetSource\n" ); LOGDEB("ResTable::resetSource\n" );
setDocSource(STD_SHARED_PTR<DocSequence>()); setDocSource(std::shared_ptr<DocSequence>());
} }
void ResTable::saveAsCSV() void ResTable::saveAsCSV()
@ -777,7 +777,7 @@ void ResTable::linkWasClicked(const QUrl &url)
// Open parent folder // Open parent folder
case 'F': case 'F':
{ {
emit editRequested(ResultPopup::getParent(STD_SHARED_PTR<DocSequence>(), emit editRequested(ResultPopup::getParent(std::shared_ptr<DocSequence>(),
m_detaildoc)); m_detaildoc));
} }
break; break;

View file

@ -23,7 +23,7 @@
#include <string> #include <string>
#include <map> #include <map>
#include <vector> #include <vector>
#include MEMORY_INCLUDE #include <memory>
#include "ui_restable.h" #include "ui_restable.h"
#include "docseq.h" #include "docseq.h"
@ -51,8 +51,8 @@ public:
virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder); virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
// Specific methods // Specific methods
virtual void readDocSource(); virtual void readDocSource();
virtual void setDocSource(STD_SHARED_PTR<DocSequence> nsource); virtual void setDocSource(std::shared_ptr<DocSequence> nsource);
virtual STD_SHARED_PTR<DocSequence> getDocSource() {return m_source;} virtual std::shared_ptr<DocSequence> getDocSource() {return m_source;}
virtual void deleteColumn(int); virtual void deleteColumn(int);
virtual const std::vector<std::string>& getFields() {return m_fields;} virtual const std::vector<std::string>& getFields() {return m_fields;}
virtual const std::map<std::string, QString>& getAllFields() virtual const std::map<std::string, QString>& getAllFields()
@ -73,7 +73,7 @@ signals:
void sortDataChanged(DocSeqSortSpec); void sortDataChanged(DocSeqSortSpec);
private: private:
mutable STD_SHARED_PTR<DocSequence> m_source; mutable std::shared_ptr<DocSequence> m_source;
std::vector<std::string> m_fields; std::vector<std::string> m_fields;
std::vector<FieldGetter*> m_getters; std::vector<FieldGetter*> m_getters;
static std::map<std::string, QString> o_displayableFields; static std::map<std::string, QString> o_displayableFields;
@ -127,7 +127,7 @@ public:
public slots: public slots:
virtual void onTableView_currentChanged(const QModelIndex&); virtual void onTableView_currentChanged(const QModelIndex&);
virtual void on_tableView_entered(const QModelIndex& index); virtual void on_tableView_entered(const QModelIndex& index);
virtual void setDocSource(STD_SHARED_PTR<DocSequence> nsource); virtual void setDocSource(std::shared_ptr<DocSequence> nsource);
virtual void saveColState(); virtual void saveColState();
virtual void resetSource(); virtual void resetSource();
virtual void readDocSource(bool resetPos = true); virtual void readDocSource(bool resetPos = true);

View file

@ -19,7 +19,7 @@
#include "autoconfig.h" #include "autoconfig.h"
#include MEMORY_INCLUDE #include <memory>
#include <QString> #include <QString>
@ -33,7 +33,7 @@ class SnippetsW : public QWidget, public Ui::Snippets
{ {
Q_OBJECT Q_OBJECT
public: public:
SnippetsW(Rcl::Doc doc, STD_SHARED_PTR<DocSequence> source, QWidget* parent = 0) SnippetsW(Rcl::Doc doc, std::shared_ptr<DocSequence> source, QWidget* parent = 0)
: QWidget(parent), m_doc(doc), m_source(source) : QWidget(parent), m_doc(doc), m_source(source)
{ {
setupUi((QDialog*)this); setupUi((QDialog*)this);
@ -52,7 +52,7 @@ signals:
private: private:
void init(); void init();
Rcl::Doc m_doc; Rcl::Doc m_doc;
STD_SHARED_PTR<DocSequence> m_source; std::shared_ptr<DocSequence> m_source;
}; };
#endif /* _SNIPPETS_W_H_INCLUDED_ */ #endif /* _SNIPPETS_W_H_INCLUDED_ */

View file

@ -362,7 +362,7 @@ void SpellW::showStats()
string reason; string reason;
string q = string("mime:") + *it; string q = string("mime:") + *it;
Rcl::SearchData *sd = wasaStringToRcl(theconfig, "", q, reason); Rcl::SearchData *sd = wasaStringToRcl(theconfig, "", q, reason);
STD_SHARED_PTR<Rcl::SearchData> rq(sd); std::shared_ptr<Rcl::SearchData> rq(sd);
Rcl::Query query(rcldb); Rcl::Query query(rcldb);
if (!query.setQuery(rq)) { if (!query.setQuery(rq)) {
LOGERR("Query setup failed: " << (query.getReason()) << "" ); LOGERR("Query setup failed: " << (query.getReason()) << "" );

View file

@ -18,7 +18,7 @@
#include <sstream> #include <sstream>
#include <set> #include <set>
#include MEMORY_INCLUDE #include <memory>
#include <qapplication.h> #include <qapplication.h>
#include <qinputdialog.h> #include <qinputdialog.h>
@ -309,7 +309,7 @@ bool SSearch::startSimpleSearch(const string& u8, int maxexp)
m_xml = xml.str(); m_xml = xml.str();
LOGDEB("SSearch::startSimpleSearch:xml:[" << (m_xml) << "]\n" ); LOGDEB("SSearch::startSimpleSearch:xml:[" << (m_xml) << "]\n" );
STD_SHARED_PTR<Rcl::SearchData> rsdata(sdata); std::shared_ptr<Rcl::SearchData> rsdata(sdata);
emit startSearch(rsdata, true); emit startSearch(rsdata, true);
return true; return true;
} }

View file

@ -27,7 +27,7 @@ class QTimer;
#include "recoll.h" #include "recoll.h"
#include "searchdata.h" #include "searchdata.h"
#include MEMORY_INCLUDE #include <memory>
#include "ui_ssearchb.h" #include "ui_ssearchb.h"
@ -73,7 +73,7 @@ public slots:
virtual void takeFocus(); virtual void takeFocus();
signals: signals:
void startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool); void startSearch(std::shared_ptr<Rcl::SearchData>, bool);
void clearSearch(); void clearSearch();
private: private:
bool m_escape; bool m_escape;

View file

@ -18,8 +18,8 @@
#include <sstream> #include <sstream>
#include <iostream> #include <iostream>
#include MEMORY_INCLUDE #include <memory>
#include UNORDERED_MAP_INCLUDE #include <unordered_map>
#ifdef _WIN32 #ifdef _WIN32
#define USING_STD_REGEX #define USING_STD_REGEX
@ -62,7 +62,7 @@ public:
class WebcacheModelInternal { class WebcacheModelInternal {
public: public:
STD_SHARED_PTR<BeagleQueueCache> cache; std::shared_ptr<BeagleQueueCache> cache;
vector<CEnt> all; vector<CEnt> all;
vector<CEnt> disp; vector<CEnt> disp;
}; };
@ -81,7 +81,7 @@ WebcacheModel::~WebcacheModel()
void WebcacheModel::reload() void WebcacheModel::reload()
{ {
m->cache = m->cache =
STD_SHARED_PTR<BeagleQueueCache>(new BeagleQueueCache(theconfig)); std::shared_ptr<BeagleQueueCache>(new BeagleQueueCache(theconfig));
m->all.clear(); m->all.clear();
m->disp.clear(); m->disp.clear();

View file

@ -20,7 +20,7 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include MEMORY_INCLUDE #include <memory>
#include "ui_webcache.h" #include "ui_webcache.h"

View file

@ -60,12 +60,12 @@
* </SD> * </SD>
*/ */
#include MEMORY_INCLUDE #include <memory>
#include "searchdata.h" #include "searchdata.h"
// Parsing XML from advanced search history or saved advanced search to to // Parsing XML from advanced search history or saved advanced search to to
// SearchData structure: // SearchData structure:
STD_SHARED_PTR<Rcl::SearchData> xmlToSearchData(const string& xml); std::shared_ptr<Rcl::SearchData> xmlToSearchData(const string& xml);
// Parsing XML from saved simple search to ssearch parameters // Parsing XML from saved simple search to ssearch parameters
struct SSearchDef { struct SSearchDef {

View file

@ -82,7 +82,7 @@ bool DocSource::buildStack()
} else { } else {
if (m_fspec.isNotNull()) { if (m_fspec.isNotNull()) {
m_seq = m_seq =
STD_SHARED_PTR<DocSequence>(new DocSeqFiltered(m_config, m_seq, m_fspec)); std::shared_ptr<DocSequence>(new DocSeqFiltered(m_config, m_seq, m_fspec));
} }
} }
@ -92,7 +92,7 @@ bool DocSource::buildStack()
} }
} else { } else {
if (m_sspec.isNotNull()) { if (m_sspec.isNotNull()) {
m_seq = STD_SHARED_PTR<DocSequence>(new DocSeqSorted(m_seq, m_sspec)); m_seq = std::shared_ptr<DocSequence>(new DocSeqSorted(m_seq, m_sspec));
} }
} }
return true; return true;

View file

@ -155,7 +155,7 @@ class DocSequence {
virtual bool canSort() {return false;} virtual bool canSort() {return false;}
virtual bool setFiltSpec(const DocSeqFiltSpec &) {return false;} virtual bool setFiltSpec(const DocSeqFiltSpec &) {return false;}
virtual bool setSortSpec(const DocSeqSortSpec &) {return false;} virtual bool setSortSpec(const DocSeqSortSpec &) {return false;}
virtual STD_SHARED_PTR<DocSequence> getSourceSeq() {return STD_SHARED_PTR<DocSequence>();} virtual std::shared_ptr<DocSequence> getSourceSeq() {return std::shared_ptr<DocSequence>();}
static void set_translations(const std::string& sort, const std::string& filt) static void set_translations(const std::string& sort, const std::string& filt)
{ {
@ -181,7 +181,7 @@ protected:
*/ */
class DocSeqModifier : public DocSequence { class DocSeqModifier : public DocSequence {
public: public:
DocSeqModifier(STD_SHARED_PTR<DocSequence> iseq) DocSeqModifier(std::shared_ptr<DocSequence> iseq)
: DocSequence(""), m_seq(iseq) : DocSequence(""), m_seq(iseq)
{} {}
virtual ~DocSeqModifier() {} virtual ~DocSeqModifier() {}
@ -241,7 +241,7 @@ public:
{ {
return m_seq->title(); return m_seq->title();
} }
virtual STD_SHARED_PTR<DocSequence> getSourceSeq() virtual std::shared_ptr<DocSequence> getSourceSeq()
{ {
return m_seq; return m_seq;
} }
@ -254,7 +254,7 @@ protected:
return m_seq->getDb(); return m_seq->getDb();
} }
STD_SHARED_PTR<DocSequence> m_seq; std::shared_ptr<DocSequence> m_seq;
}; };
class RclConfig; class RclConfig;
@ -263,7 +263,7 @@ class RclConfig;
// sorting and filtering in ways depending on the base seqs capabilities // sorting and filtering in ways depending on the base seqs capabilities
class DocSource : public DocSeqModifier { class DocSource : public DocSeqModifier {
public: public:
DocSource(RclConfig *config, STD_SHARED_PTR<DocSequence> iseq) DocSource(RclConfig *config, std::shared_ptr<DocSequence> iseq)
: DocSeqModifier(iseq), m_config(config) : DocSeqModifier(iseq), m_config(config)
{} {}
virtual bool canFilter() {return true;} virtual bool canFilter() {return true;}

View file

@ -28,8 +28,8 @@
using std::list; using std::list;
DocSequenceDb::DocSequenceDb(STD_SHARED_PTR<Rcl::Query> q, const string &t, DocSequenceDb::DocSequenceDb(std::shared_ptr<Rcl::Query> q, const string &t,
STD_SHARED_PTR<Rcl::SearchData> sdata) std::shared_ptr<Rcl::SearchData> sdata)
: DocSequence(t), m_q(q), m_sdata(sdata), m_fsdata(sdata), : DocSequence(t), m_q(q), m_sdata(sdata), m_fsdata(sdata),
m_rescnt(-1), m_rescnt(-1),
m_queryBuildAbstract(true), m_queryBuildAbstract(true),
@ -164,7 +164,7 @@ bool DocSequenceDb::setFiltSpec(const DocSeqFiltSpec &fs)
std::unique_lock<std::mutex> locker(o_dblock); std::unique_lock<std::mutex> locker(o_dblock);
if (fs.isNotNull()) { if (fs.isNotNull()) {
// We build a search spec by adding a filtering layer to the base one. // We build a search spec by adding a filtering layer to the base one.
m_fsdata = STD_SHARED_PTR<Rcl::SearchData>( m_fsdata = std::shared_ptr<Rcl::SearchData>(
new Rcl::SearchData(Rcl::SCLT_AND, m_sdata->getStemLang())); new Rcl::SearchData(Rcl::SCLT_AND, m_sdata->getStemLang()));
Rcl::SearchDataClauseSub *cl = Rcl::SearchDataClauseSub *cl =
new Rcl::SearchDataClauseSub(m_sdata); new Rcl::SearchDataClauseSub(m_sdata);
@ -188,7 +188,7 @@ bool DocSequenceDb::setFiltSpec(const DocSeqFiltSpec &fs)
if (sd) { if (sd) {
Rcl::SearchDataClauseSub *cl1 = Rcl::SearchDataClauseSub *cl1 =
new Rcl::SearchDataClauseSub( new Rcl::SearchDataClauseSub(
STD_SHARED_PTR<Rcl::SearchData>(sd)); std::shared_ptr<Rcl::SearchData>(sd));
m_fsdata->addClause(cl1); m_fsdata->addClause(cl1);
} }
} }

View file

@ -17,7 +17,7 @@
#ifndef _DOCSEQDB_H_INCLUDED_ #ifndef _DOCSEQDB_H_INCLUDED_
#define _DOCSEQDB_H_INCLUDED_ #define _DOCSEQDB_H_INCLUDED_
#include "docseq.h" #include "docseq.h"
#include MEMORY_INCLUDE #include <memory>
#include "searchdata.h" #include "searchdata.h"
#include "rclquery.h" #include "rclquery.h"
@ -25,8 +25,8 @@
/** A DocSequence from a Db query */ /** A DocSequence from a Db query */
class DocSequenceDb : public DocSequence { class DocSequenceDb : public DocSequence {
public: public:
DocSequenceDb(STD_SHARED_PTR<Rcl::Query> q, const string &t, DocSequenceDb(std::shared_ptr<Rcl::Query> q, const string &t,
STD_SHARED_PTR<Rcl::SearchData> sdata); std::shared_ptr<Rcl::SearchData> sdata);
virtual ~DocSequenceDb() {} virtual ~DocSequenceDb() {}
virtual bool getDoc(int num, Rcl::Doc &doc, string * = 0); virtual bool getDoc(int num, Rcl::Doc &doc, string * = 0);
virtual int getResCnt(); virtual int getResCnt();
@ -60,9 +60,9 @@ class DocSequenceDb : public DocSequence {
protected: protected:
virtual Rcl::Db *getDb(); virtual Rcl::Db *getDb();
private: private:
STD_SHARED_PTR<Rcl::Query> m_q; std::shared_ptr<Rcl::Query> m_q;
STD_SHARED_PTR<Rcl::SearchData> m_sdata; std::shared_ptr<Rcl::SearchData> m_sdata;
STD_SHARED_PTR<Rcl::SearchData> m_fsdata; // Filtered std::shared_ptr<Rcl::SearchData> m_fsdata; // Filtered
int m_rescnt; int m_rescnt;
bool m_queryBuildAbstract; bool m_queryBuildAbstract;
bool m_queryReplaceAbstract; bool m_queryReplaceAbstract;

View file

@ -46,7 +46,7 @@ static bool filter(const DocSeqFiltSpec& fs, const Rcl::Doc *x)
return false; return false;
} }
DocSeqFiltered::DocSeqFiltered(RclConfig *conf, STD_SHARED_PTR<DocSequence> iseq, DocSeqFiltered::DocSeqFiltered(RclConfig *conf, std::shared_ptr<DocSequence> iseq,
DocSeqFiltSpec &filtspec) DocSeqFiltSpec &filtspec)
: DocSeqModifier(iseq), m_config(conf) : DocSeqModifier(iseq), m_config(conf)
{ {

View file

@ -20,7 +20,7 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include MEMORY_INCLUDE #include <memory>
#include "docseq.h" #include "docseq.h"
@ -32,7 +32,7 @@ class RclConfig;
*/ */
class DocSeqFiltered : public DocSeqModifier { class DocSeqFiltered : public DocSeqModifier {
public: public:
DocSeqFiltered(RclConfig *conf, STD_SHARED_PTR<DocSequence> iseq, DocSeqFiltered(RclConfig *conf, std::shared_ptr<DocSequence> iseq,
DocSeqFiltSpec &filtspec); DocSeqFiltSpec &filtspec);
virtual ~DocSeqFiltered() {} virtual ~DocSeqFiltered() {}
virtual bool canFilter() {return true;} virtual bool canFilter() {return true;}

View file

@ -342,7 +342,7 @@ endopts:
return 1; return 1;
} }
STD_SHARED_PTR<Rcl::SearchData> rq(sd); std::shared_ptr<Rcl::SearchData> rq(sd);
Rcl::Query query(&rcldb); Rcl::Query query(&rcldb);
if (op_flags & OPT_S) { if (op_flags & OPT_S) {
query.setSortBy(sortfield, (op_flags & OPT_D) ? false : true); query.setSortBy(sortfield, (op_flags & OPT_D) ? false : true);

View file

@ -20,7 +20,7 @@
#include "autoconfig.h" #include "autoconfig.h"
#include <vector> #include <vector>
#include MEMORY_INCLUDE #include <memory>
#include "docseq.h" #include "docseq.h"
#include "hldata.h" #include "hldata.h"
@ -40,7 +40,7 @@ public:
{ {
m_hiliter = ptr; m_hiliter = ptr;
} }
void setDocSource(STD_SHARED_PTR<DocSequence> src, int winfirst = -1) void setDocSource(std::shared_ptr<DocSequence> src, int winfirst = -1)
{ {
m_pagesize = m_newpagesize; m_pagesize = m_newpagesize;
m_winfirst = winfirst; m_winfirst = winfirst;
@ -129,7 +129,7 @@ private:
int m_winfirst; int m_winfirst;
bool m_hasNext; bool m_hasNext;
PlainToRich *m_hiliter; PlainToRich *m_hiliter;
STD_SHARED_PTR<DocSequence> m_docSource; std::shared_ptr<DocSequence> m_docSource;
std::vector<ResListEntry> m_respage; std::vector<ResListEntry> m_respage;
}; };

View file

@ -20,7 +20,7 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include MEMORY_INCLUDE #include <memory>
#include "docseq.h" #include "docseq.h"
@ -30,7 +30,7 @@
*/ */
class DocSeqSorted : public DocSeqModifier { class DocSeqSorted : public DocSeqModifier {
public: public:
DocSeqSorted(STD_SHARED_PTR<DocSequence> iseq, DocSeqSortSpec &sortspec) DocSeqSorted(std::shared_ptr<DocSequence> iseq, DocSeqSortSpec &sortspec)
: DocSeqModifier(iseq) : DocSeqModifier(iseq)
{ {
setSortSpec(sortspec); setSortSpec(sortspec);

View file

@ -65,7 +65,7 @@ static void addSubQuery(WasaParserDriver *d,
{ {
if (sd && sq) if (sd && sq)
sd->addClause( sd->addClause(
new Rcl::SearchDataClauseSub(STD_SHARED_PTR<Rcl::SearchData>(sq))); new Rcl::SearchDataClauseSub(std::shared_ptr<Rcl::SearchData>(sq)));
} }

View file

@ -18,7 +18,7 @@
#include "autoconfig.h" #include "autoconfig.h"
#include MEMORY_INCLUDE #include <memory>
#include "log.h" #include "log.h"
#include "utf8iter.h" #include "utf8iter.h"
@ -57,9 +57,9 @@ bool createExpansionDbs(Xapian::WritableDatabase& wdb,
vector<XapWritableComputableSynFamMember> stemdbs; vector<XapWritableComputableSynFamMember> stemdbs;
// Note: tried to make this to work with stack-allocated objects, couldn't. // Note: tried to make this to work with stack-allocated objects, couldn't.
// Looks like a bug in copy constructors somewhere, can't guess where // Looks like a bug in copy constructors somewhere, can't guess where
vector<STD_SHARED_PTR<SynTermTransStem> > stemmers; vector<std::shared_ptr<SynTermTransStem> > stemmers;
for (unsigned int i = 0; i < langs.size(); i++) { for (unsigned int i = 0; i < langs.size(); i++) {
stemmers.push_back(STD_SHARED_PTR<SynTermTransStem> stemmers.push_back(std::shared_ptr<SynTermTransStem>
(new SynTermTransStem(langs[i]))); (new SynTermTransStem(langs[i])));
stemdbs.push_back( stemdbs.push_back(
XapWritableComputableSynFamMember(wdb, synFamStem, langs[i], XapWritableComputableSynFamMember(wdb, synFamStem, langs[i],

View file

@ -357,7 +357,7 @@ int Query::Native::makeAbstract(Xapian::docid docid,
map<unsigned int, string> sparseDoc; map<unsigned int, string> sparseDoc;
// Also remember apart the search term positions so that we can list // Also remember apart the search term positions so that we can list
// them with their snippets. // them with their snippets.
STD_UNORDERED_SET<unsigned int> searchTermPositions; std::unordered_set<unsigned int> searchTermPositions;
// Remember max position. Used to stop walking positions lists while // Remember max position. Used to stop walking positions lists while
// populating the adjacent slots. // populating the adjacent slots.

View file

@ -572,7 +572,7 @@ bool Db::Native::addOrUpdateWrite(const string& udi, const string& uniterm,
Chrono chron; Chrono chron;
std::unique_lock<std::mutex> lock(m_mutex); std::unique_lock<std::mutex> lock(m_mutex);
#endif #endif
STD_SHARED_PTR<Xapian::Document> doc_cleaner(newdocument_ptr); std::shared_ptr<Xapian::Document> doc_cleaner(newdocument_ptr);
// Check file system full every mbyte of indexed text. It's a bit wasteful // Check file system full every mbyte of indexed text. It's a bit wasteful
// to do this after having prepared the document, but it needs to be in // to do this after having prepared the document, but it needs to be in

View file

@ -21,7 +21,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include MEMORY_INCLUDE #include <memory>
#include "cstr.h" #include "cstr.h"
#include "rcldoc.h" #include "rcldoc.h"

View file

@ -70,7 +70,7 @@ bool Db::docDups(const Doc& idoc, vector<Doc>& odocs)
MD5HexPrint(digest, md5); MD5HexPrint(digest, md5);
SearchData *sdp = new SearchData(); SearchData *sdp = new SearchData();
STD_SHARED_PTR<SearchData> sd(sdp); std::shared_ptr<SearchData> sd(sdp);
SearchDataClauseSimple *sdc = SearchDataClauseSimple *sdc =
new SearchDataClauseSimple(SCLT_AND, md5, "rclmd5"); new SearchDataClauseSimple(SCLT_AND, md5, "rclmd5");
sdc->addModifier(SearchDataClause::SDCM_CASESENS); sdc->addModifier(SearchDataClause::SDCM_CASESENS);

View file

@ -173,7 +173,7 @@ void Query::setSortBy(const string& fld, bool ascending) {
#define ISNULL(X) !(X) #define ISNULL(X) !(X)
// Prepare query out of user search data // Prepare query out of user search data
bool Query::setQuery(STD_SHARED_PTR<SearchData> sdata) bool Query::setQuery(std::shared_ptr<SearchData> sdata)
{ {
LOGDEB("Query::setQuery:\n" ); LOGDEB("Query::setQuery:\n" );

View file

@ -19,7 +19,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include MEMORY_INCLUDE #include <memory>
#include "searchdata.h" #include "searchdata.h"
#ifndef NO_NAMESPACES #ifndef NO_NAMESPACES
@ -92,7 +92,7 @@ class Query {
* be called repeatedly on the same object which gets reinitialized each * be called repeatedly on the same object which gets reinitialized each
* time. * time.
*/ */
bool setQuery(STD_SHARED_PTR<SearchData> q); bool setQuery(std::shared_ptr<SearchData> q);
/** Get results count for current query */ /** Get results count for current query */
int getResCnt(); int getResCnt();
@ -117,7 +117,7 @@ class Query {
int getFirstMatchPage(const Doc &doc, std::string& term); int getFirstMatchPage(const Doc &doc, std::string& term);
/** Retrieve a reference to the searchData we are using */ /** Retrieve a reference to the searchData we are using */
STD_SHARED_PTR<SearchData> getSD() std::shared_ptr<SearchData> getSD()
{ {
return m_sd; return m_sd;
} }
@ -143,7 +143,7 @@ private:
bool m_sortAscending; bool m_sortAscending;
bool m_collapseDuplicates; bool m_collapseDuplicates;
int m_resCnt; int m_resCnt;
STD_SHARED_PTR<SearchData> m_sd; std::shared_ptr<SearchData> m_sd;
int m_snipMaxPosWalk; int m_snipMaxPosWalk;
/* Copyconst and assignement private and forbidden */ /* Copyconst and assignement private and forbidden */

View file

@ -185,11 +185,11 @@ bool Db::termMatch(int typ_sens, const string &lang, const string &_term,
XapComputableSynFamMember synac(xrdb, synFamDiCa, "all", &unacfoldtrans); XapComputableSynFamMember synac(xrdb, synFamDiCa, "all", &unacfoldtrans);
if (matchtyp == ET_WILD || matchtyp == ET_REGEXP) { if (matchtyp == ET_WILD || matchtyp == ET_REGEXP) {
STD_SHARED_PTR<StrMatcher> matcher; std::shared_ptr<StrMatcher> matcher;
if (matchtyp == ET_WILD) { if (matchtyp == ET_WILD) {
matcher = STD_SHARED_PTR<StrMatcher>(new StrWildMatcher(term)); matcher = std::shared_ptr<StrMatcher>(new StrWildMatcher(term));
} else { } else {
matcher = STD_SHARED_PTR<StrMatcher>(new StrRegexpMatcher(term)); matcher = std::shared_ptr<StrMatcher>(new StrRegexpMatcher(term));
} }
if (!diac_sensitive || !case_sensitive) { if (!diac_sensitive || !case_sensitive) {
// Perform case/diac expansion on the exp as appropriate and // Perform case/diac expansion on the exp as appropriate and
@ -355,15 +355,15 @@ bool Db::idxTermMatch(int typ_sens, const string &lang, const string &root,
} }
res.prefix = prefix; res.prefix = prefix;
STD_SHARED_PTR<StrMatcher> matcher; std::shared_ptr<StrMatcher> matcher;
if (typ == ET_REGEXP) { if (typ == ET_REGEXP) {
matcher = STD_SHARED_PTR<StrMatcher>(new StrRegexpMatcher(root)); matcher = std::shared_ptr<StrMatcher>(new StrRegexpMatcher(root));
if (!matcher->ok()) { if (!matcher->ok()) {
LOGERR("termMatch: regcomp failed: " << (matcher->getreason())); LOGERR("termMatch: regcomp failed: " << (matcher->getreason()));
return false; return false;
} }
} else if (typ == ET_WILD) { } else if (typ == ET_WILD) {
matcher = STD_SHARED_PTR<StrMatcher>(new StrWildMatcher(root)); matcher = std::shared_ptr<StrMatcher>(new StrWildMatcher(root));
} }
// Find the initial section before any special char // Find the initial section before any special char

View file

@ -162,7 +162,7 @@ bool SearchData::maybeAddAutoPhrase(Rcl::Db& db, double freqThreshold)
// an actual user-entered phrase // an actual user-entered phrase
slack += 1 + nwords / 3; slack += 1 + nwords / 3;
m_autophrase = STD_SHARED_PTR<SearchDataClauseDist>( m_autophrase = std::shared_ptr<SearchDataClauseDist>(
new SearchDataClauseDist(SCLT_PHRASE, swords, slack, field)); new SearchDataClauseDist(SCLT_PHRASE, swords, slack, field));
return true; return true;
} }

View file

@ -29,7 +29,7 @@
#include <ostream> #include <ostream>
#include "rcldb.h" #include "rcldb.h"
#include MEMORY_INCLUDE #include <memory>
#include "smallut.h" #include "smallut.h"
#include "cstr.h" #include "cstr.h"
#include "hldata.h" #include "hldata.h"
@ -178,7 +178,7 @@ private:
std::vector<std::string> m_nfiletypes; std::vector<std::string> m_nfiletypes;
// Autophrase if set. Can't be part of the normal chain because // Autophrase if set. Can't be part of the normal chain because
// it uses OP_AND_MAYBE // it uses OP_AND_MAYBE
STD_SHARED_PTR<SearchDataClauseDist> m_autophrase; std::shared_ptr<SearchDataClauseDist> m_autophrase;
// Special stuff produced by input which looks like a clause but means // Special stuff produced by input which looks like a clause but means
// something else (date and size specs) // something else (date and size specs)
@ -493,7 +493,7 @@ private:
/** Subquery */ /** Subquery */
class SearchDataClauseSub : public SearchDataClause { class SearchDataClauseSub : public SearchDataClause {
public: public:
SearchDataClauseSub(STD_SHARED_PTR<SearchData> sub) SearchDataClauseSub(std::shared_ptr<SearchData> sub)
: SearchDataClause(SCLT_SUB), m_sub(sub) : SearchDataClause(SCLT_SUB), m_sub(sub)
{ {
} }
@ -509,13 +509,13 @@ public:
{ {
m_sub.get()->getTerms(hldata); m_sub.get()->getTerms(hldata);
} }
virtual STD_SHARED_PTR<SearchData> getSub() { virtual std::shared_ptr<SearchData> getSub() {
return m_sub; return m_sub;
} }
virtual void dump(ostream& o) const; virtual void dump(ostream& o) const;
protected: protected:
STD_SHARED_PTR<SearchData> m_sub; std::shared_ptr<SearchData> m_sub;
}; };
} // Namespace Rcl } // Namespace Rcl

View file

@ -20,7 +20,7 @@
#include <iostream> #include <iostream>
#include <algorithm> #include <algorithm>
#include MEMORY_INCLUDE #include <memory>
#include "log.h" #include "log.h"
#include "cstr.h" #include "cstr.h"
@ -183,9 +183,9 @@ bool XapComputableSynFamMember::synKeyExpand(StrMatcher* inexp,
LOGDEB("XapCompSynFam::synKeyExpand: [" << (inexp->exp()) << "]\n" ); LOGDEB("XapCompSynFam::synKeyExpand: [" << (inexp->exp()) << "]\n" );
// If set, compute filtering term (e.g.: only case-folded) // If set, compute filtering term (e.g.: only case-folded)
STD_SHARED_PTR<StrMatcher> filter_exp; std::shared_ptr<StrMatcher> filter_exp;
if (filtertrans) { if (filtertrans) {
filter_exp = STD_SHARED_PTR<StrMatcher>(inexp->clone()); filter_exp = std::shared_ptr<StrMatcher>(inexp->clone());
filter_exp->setExp((*filtertrans)(inexp->exp())); filter_exp->setExp((*filtertrans)(inexp->exp()));
} }

View file

@ -30,7 +30,7 @@
#include <zlib.h> #include <zlib.h>
#include "chrono.h" #include "chrono.h"
#include MEMORY_INCLUDE #include <memory>
#ifndef _WIN32 #ifndef _WIN32
@ -1353,8 +1353,8 @@ static bool inflateToDynBuf(void* inp, UINT inlen, void **outpp, UINT *outlenp)
} }
// Copy all entries from occ to ncc. Both are already open. // Copy all entries from occ to ncc. Both are already open.
static bool copyall(STD_SHARED_PTR<CirCache> occ, static bool copyall(std::shared_ptr<CirCache> occ,
STD_SHARED_PTR<CirCache> ncc, int& nentries, std::shared_ptr<CirCache> ncc, int& nentries,
ostringstream& msg) ostringstream& msg)
{ {
bool eof = false; bool eof = false;
@ -1399,7 +1399,7 @@ int CirCache::append(const string ddir, const string& sdir, string *reason)
{ {
ostringstream msg; ostringstream msg;
// Open source file // Open source file
STD_SHARED_PTR<CirCache> occ(new CirCache(sdir)); std::shared_ptr<CirCache> occ(new CirCache(sdir));
if (!occ->open(CirCache::CC_OPREAD)) { if (!occ->open(CirCache::CC_OPREAD)) {
if (reason) { if (reason) {
msg << "Open failed in " << sdir << " : " << msg << "Open failed in " << sdir << " : " <<
@ -1409,7 +1409,7 @@ int CirCache::append(const string ddir, const string& sdir, string *reason)
return -1; return -1;
} }
// Open dest file // Open dest file
STD_SHARED_PTR<CirCache> ncc(new CirCache(ddir)); std::shared_ptr<CirCache> ncc(new CirCache(ddir));
if (!ncc->open(CirCache::CC_OPWRITE)) { if (!ncc->open(CirCache::CC_OPWRITE)) {
if (reason) { if (reason) {
msg << "Open failed in " << ddir << " : " << msg << "Open failed in " << ddir << " : " <<
@ -1444,7 +1444,7 @@ int CirCache::append(const string ddir, const string& sdir, string *reason)
#include <string> #include <string>
#include <iostream> #include <iostream>
#include MEMORY_INCLUDE #include <memory>
#include "circache.h" #include "circache.h"
#include "fileudi.h" #include "fileudi.h"

View file

@ -77,10 +77,10 @@ public:
string m_stderrFile; string m_stderrFile;
// Pipe for data going to the command // Pipe for data going to the command
int m_pipein[2]; int m_pipein[2];
STD_SHARED_PTR<NetconCli> m_tocmd; std::shared_ptr<NetconCli> m_tocmd;
// Pipe for data coming out // Pipe for data coming out
int m_pipeout[2]; int m_pipeout[2];
STD_SHARED_PTR<NetconCli> m_fromcmd; std::shared_ptr<NetconCli> m_fromcmd;
// Subprocess id // Subprocess id
pid_t m_pid; pid_t m_pid;
// Saved sigmask // Saved sigmask
@ -642,14 +642,14 @@ int ExecCmd::startExec(const string& cmd, const vector<string>& args,
m->m_pipein[0] = -1; m->m_pipein[0] = -1;
NetconCli *iclicon = new NetconCli(); NetconCli *iclicon = new NetconCli();
iclicon->setconn(m->m_pipein[1]); iclicon->setconn(m->m_pipein[1]);
m->m_tocmd = STD_SHARED_PTR<NetconCli>(iclicon); m->m_tocmd = std::shared_ptr<NetconCli>(iclicon);
} }
if (has_output) { if (has_output) {
close(m->m_pipeout[1]); close(m->m_pipeout[1]);
m->m_pipeout[1] = -1; m->m_pipeout[1] = -1;
NetconCli *oclicon = new NetconCli(); NetconCli *oclicon = new NetconCli();
oclicon->setconn(m->m_pipeout[0]); oclicon->setconn(m->m_pipeout[0]);
m->m_fromcmd = STD_SHARED_PTR<NetconCli>(oclicon); m->m_fromcmd = std::shared_ptr<NetconCli>(oclicon);
} }
/* Don't want to undo what we just did ! */ /* Don't want to undo what we just did ! */
@ -757,7 +757,7 @@ int ExecCmd::doexec(const string& cmd, const vector<string>& args,
LOGERR("ExecCmd::doexec: no connection from command\n"); LOGERR("ExecCmd::doexec: no connection from command\n");
return -1; return -1;
} }
oclicon->setcallback(STD_SHARED_PTR<NetconWorker> oclicon->setcallback(std::shared_ptr<NetconWorker>
(new ExecReader(output, m->m_advise))); (new ExecReader(output, m->m_advise)));
myloop.addselcon(m->m_fromcmd, Netcon::NETCONPOLL_READ); myloop.addselcon(m->m_fromcmd, Netcon::NETCONPOLL_READ);
// Give up ownership // Give up ownership
@ -770,7 +770,7 @@ int ExecCmd::doexec(const string& cmd, const vector<string>& args,
LOGERR("ExecCmd::doexec: no connection from command\n"); LOGERR("ExecCmd::doexec: no connection from command\n");
return -1; return -1;
} }
iclicon->setcallback(STD_SHARED_PTR<NetconWorker> iclicon->setcallback(std::shared_ptr<NetconWorker>
(new ExecWriter(input, m->m_provide, m))); (new ExecWriter(input, m->m_provide, m)));
myloop.addselcon(m->m_tocmd, Netcon::NETCONPOLL_WRITE); myloop.addselcon(m->m_tocmd, Netcon::NETCONPOLL_WRITE);
// Give up ownership // Give up ownership

View file

@ -1208,8 +1208,8 @@ int trycli(char *host, char *serv)
} }
} }
#else #else
STD_SHARED_PTR<NetconWorker> worker = std::shared_ptr<NetconWorker> worker =
STD_SHARED_PTR<NetconWorker>(new CliNetconWorker()); std::shared_ptr<NetconWorker>(new CliNetconWorker());
clicon->setcallback(worker); clicon->setcallback(worker);
SelectLoop myloop; SelectLoop myloop;
myloop.addselcon(con, Netcon::NETCONPOLL_WRITE); myloop.addselcon(con, Netcon::NETCONPOLL_WRITE);
@ -1274,8 +1274,8 @@ protected:
if (con == 0) { if (con == 0) {
return -1; return -1;
} }
STD_SHARED_PTR<NetconWorker> worker = std::shared_ptr<NetconWorker> worker =
STD_SHARED_PTR<NetconWorker>(new ServNetconWorker()); std::shared_ptr<NetconWorker>(new ServNetconWorker());
con->setcallback(worker); con->setcallback(worker);
m_loop.addselcon(NetconP(con), NETCONPOLL_READ); m_loop.addselcon(NetconP(con), NETCONPOLL_READ);
return 1; return 1;

View file

@ -26,7 +26,7 @@
#include <map> #include <map>
#include <string> #include <string>
#include MEMORY_INCLUDE #include <memory>
/// A set of classes to manage client-server communication over a /// A set of classes to manage client-server communication over a
/// connection-oriented network, or a pipe. /// connection-oriented network, or a pipe.
@ -43,7 +43,7 @@
/// Base class for all network endpoints: /// Base class for all network endpoints:
class Netcon; class Netcon;
typedef STD_SHARED_PTR<Netcon> NetconP; typedef std::shared_ptr<Netcon> NetconP;
class SelectLoop; class SelectLoop;
class Netcon { class Netcon {
@ -246,7 +246,7 @@ public:
virtual int getline(char *buf, int cnt, int timeo = -1); virtual int getline(char *buf, int cnt, int timeo = -1);
/// Set handler to be called when the connection is placed in the /// Set handler to be called when the connection is placed in the
/// selectloop and an event occurs. /// selectloop and an event occurs.
virtual void setcallback(STD_SHARED_PTR<NetconWorker> user) { virtual void setcallback(std::shared_ptr<NetconWorker> user) {
m_user = user; m_user = user;
} }
@ -255,7 +255,7 @@ private:
char *m_bufbase; // Pointer to current 1st byte of useful data char *m_bufbase; // Pointer to current 1st byte of useful data
int m_bufbytes; // Bytes of data. int m_bufbytes; // Bytes of data.
int m_bufsize; // Total buffer size int m_bufsize; // Total buffer size
STD_SHARED_PTR<NetconWorker> m_user; std::shared_ptr<NetconWorker> m_user;
virtual int cando(Netcon::Event reason); // Selectloop slot virtual int cando(Netcon::Event reason); // Selectloop slot
}; };

View file

@ -23,7 +23,7 @@
#include <map> #include <map>
#include <string> #include <string>
#include MEMORY_INCLUDE #include <memory>
extern void rclutil_init_mt(); extern void rclutil_init_mt();
@ -70,7 +70,7 @@ private:
bool m_noremove; bool m_noremove;
}; };
typedef STD_SHARED_PTR<TempFileInternal> TempFile; typedef std::shared_ptr<TempFileInternal> TempFile;
/// Temporary directory class. Recursively deleted by destructor. /// Temporary directory class. Recursively deleted by destructor.
class TempDir { class TempDir {

View file

@ -42,8 +42,8 @@
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <list> #include <list>
#include UNORDERED_MAP_INCLUDE #include <unordered_map>
#include UNORDERED_SET_INCLUDE #include <unordered_set>
#include "smallut.h" #include "smallut.h"
@ -323,8 +323,8 @@ template bool stringToStrings<vector<string> >(const string&,
vector<string>&, const string&); vector<string>&, const string&);
template bool stringToStrings<set<string> >(const string&, template bool stringToStrings<set<string> >(const string&,
set<string>&, const string&); set<string>&, const string&);
template bool stringToStrings<STD_UNORDERED_SET<string> > template bool stringToStrings<std::unordered_set<string> >
(const string&, STD_UNORDERED_SET<string>&, const string&); (const string&, std::unordered_set<string>&, const string&);
template <class T> void stringsToString(const T& tokens, string& s) template <class T> void stringsToString(const T& tokens, string& s)
{ {
@ -1195,14 +1195,14 @@ static const string cstr_cp1252("CP1252");
string langtocode(const string& lang) string langtocode(const string& lang)
{ {
static STD_UNORDERED_MAP<string, string> lang_to_code; static std::unordered_map<string, string> lang_to_code;
if (lang_to_code.empty()) { if (lang_to_code.empty()) {
for (unsigned int i = 0; for (unsigned int i = 0;
i < sizeof(vlang_to_code) / sizeof(char *); i += 2) { i < sizeof(vlang_to_code) / sizeof(char *); i += 2) {
lang_to_code[vlang_to_code[i]] = vlang_to_code[i + 1]; lang_to_code[vlang_to_code[i]] = vlang_to_code[i + 1];
} }
} }
STD_UNORDERED_MAP<string, string>::const_iterator it = std::unordered_map<string, string>::const_iterator it =
lang_to_code.find(lang); lang_to_code.find(lang);
// Use cp1252 by default... // Use cp1252 by default...

View file

@ -23,7 +23,7 @@
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include UNORDERED_MAP_INCLUDE #include <unordered_map>
#include "log.h" #include "log.h"
#include "safesysstat.h" #include "safesysstat.h"
@ -108,12 +108,12 @@ static string argvToCmdLine(const string& cmd, const vector<string>& args)
} }
// Merge the father environment with the variable specified in m_env // Merge the father environment with the variable specified in m_env
static char *mergeEnvironment(const STD_UNORDERED_MAP<string, string>& addenv) static char *mergeEnvironment(const std::unordered_map<string, string>& addenv)
{ {
// Parse existing environment. // Parse existing environment.
char *envir = GetEnvironmentStrings(); char *envir = GetEnvironmentStrings();
char *cp0 = envir; char *cp0 = envir;
STD_UNORDERED_MAP<string, string> envirmap; std::unordered_map<string, string> envirmap;
string name, value; string name, value;
for (char *cp1 = cp0;;cp1++) { for (char *cp1 = cp0;;cp1++) {
@ -277,7 +277,7 @@ public:
reset(); reset();
} }
STD_UNORDERED_MAP<string, string> m_env; std::unordered_map<string, string> m_env;
ExecCmdAdvise *m_advise; ExecCmdAdvise *m_advise;
ExecCmdProvide *m_provide; ExecCmdProvide *m_provide;
int m_timeoutMs; int m_timeoutMs;