Switch to unified view

a/src/rcldb/searchdata.h b/src/rcldb/searchdata.h
...
...
44
    SCLT_OR, SCLT_FILENAME, SCLT_PHRASE, SCLT_NEAR, SCLT_PATH,
44
    SCLT_OR, SCLT_FILENAME, SCLT_PHRASE, SCLT_NEAR, SCLT_PATH,
45
    SCLT_SUB
45
    SCLT_SUB
46
};
46
};
47
47
48
class SearchDataClause;
48
class SearchDataClause;
49
class SearchDataClauseDist;
49
50
50
/** 
51
/** 
51
    A SearchData object represents a Recoll user query, for translation
52
    A SearchData object represents a Recoll user query, for translation
52
    into a Xapian query tree. This could probably better called a 'question'.
53
    into a Xapian query tree. This could probably better called a 'question'.
53
54
...
...
87
    : m_tp(SCLT_AND)
88
    : m_tp(SCLT_AND)
88
    {
89
    {
89
    commoninit();
90
    commoninit();
90
    }
91
    }
91
    
92
    
92
    ~SearchData() 
93
    ~SearchData();
93
    {
94
  erase();
95
    }
96
97
    /** Make pristine */
98
    void erase();
99
94
100
    /** Is there anything but a file name search in here ? */
95
    /** Is there anything but a file name search in here ? */
101
    bool fileNameOnly();
96
    bool fileNameOnly();
102
97
103
    /** Do we have wildcards anywhere apart from filename searches ? */
98
    /** Do we have wildcards anywhere apart from filename searches ? */
...
...
173
    std::vector<SearchDataClause*> m_query;
168
    std::vector<SearchDataClause*> m_query;
174
    // Restricted set of filetypes if not empty.
169
    // Restricted set of filetypes if not empty.
175
    std::vector<std::string>            m_filetypes; 
170
    std::vector<std::string>            m_filetypes; 
176
    // Excluded set of file types if not empty
171
    // Excluded set of file types if not empty
177
    std::vector<std::string>            m_nfiletypes;
172
    std::vector<std::string>            m_nfiletypes;
178
173
    // Autophrase if set. Can't be part of the normal chain because
174
    // it uses OP_AND_MAYBE
175
    RefCntr<SearchDataClauseDist>   m_autophrase;
176
    // 
179
    bool                      m_haveDates;
177
    bool                      m_haveDates;
180
    DateInterval              m_dates; // Restrict to date interval
178
    DateInterval              m_dates; // Restrict to date interval
181
    size_t                    m_maxSize;
179
    size_t                    m_maxSize;
182
    size_t                    m_minSize;
180
    size_t                    m_minSize;
183
    // Printable expanded version of the complete query, retrieved/set
181
    // Printable expanded version of the complete query, retrieved/set
...
...
459
};
457
};
460
458
461
/** Subquery */
459
/** Subquery */
462
class SearchDataClauseSub : public SearchDataClause {
460
class SearchDataClauseSub : public SearchDataClause {
463
public:
461
public:
464
    SearchDataClauseSub(SClType tp, RefCntr<SearchData> sub) 
462
    SearchDataClauseSub(RefCntr<SearchData> sub) 
465
    : SearchDataClause(tp), m_sub(sub) 
463
    : SearchDataClause(SCLT_SUB), m_sub(sub) 
466
    {
464
    {
467
    }
465
    }
468
    virtual bool toNativeQuery(Rcl::Db &db, void *p)
466
    virtual bool toNativeQuery(Rcl::Db &db, void *p)
469
    {
467
    {
470
    bool ret = m_sub->toNativeQuery(db, p);
468
    bool ret = m_sub->toNativeQuery(db, p);