express query language OR chains as rcldb subqueries so that field specs will work inside them

This commit is contained in:
dockes
2008-01-16 11:14:38 +00:00
parent a0f6c46874
commit 3223e8dc03
3 changed files with 41 additions and 32 deletions
+8 -1
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: searchdata.cpp,v 1.20 2008-01-16 08:43:26 dockes Exp $ (C) 2006 J.F.Dockes";
static char rcsid[] = "@(#$Id: searchdata.cpp,v 1.21 2008-01-16 11:14:38 dockes Exp $ (C) 2006 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -607,4 +607,11 @@ bool SearchDataClauseDist::toNativeQuery(Rcl::Db &db, void *p,
return true;
}
// Translate subquery
bool SearchDataClauseSub::toNativeQuery(Rcl::Db &db, void *p,
const string& stemlang)
{
return m_sub->toNativeQuery(db, p, stemlang);
}
} // Namespace Rcl
+6 -7
View File
@@ -16,7 +16,7 @@
*/
#ifndef _SEARCHDATA_H_INCLUDED_
#define _SEARCHDATA_H_INCLUDED_
/* @(#$Id: searchdata.h,v 1.10 2007-02-13 10:58:32 dockes Exp $ (C) 2004 J.F.Dockes */
/* @(#$Id: searchdata.h,v 1.11 2008-01-16 11:14:38 dockes Exp $ (C) 2004 J.F.Dockes */
/**
* Structures to hold data coming almost directly from the gui
@@ -222,19 +222,18 @@ public:
// m_slack is declared in SearchDataClauseSimple
};
#ifdef NOTNOW
/** Future pointer to subquery ? */
class SearchDataClauseSub : public SearchDataClause {
public:
SearchDataClauseSub(SClType tp, SClType stp)
: SearchDataClause(tp), m_sub(stp) {}
virtual ~SearchDataClauseSub() {}
// Note that we take charge of the SearchData * and will delete it.
SearchDataClauseSub(SClType tp, SearchData *sub)
: SearchDataClause(tp), m_sub(sub) {}
virtual ~SearchDataClauseSub() {delete m_sub; m_sub = 0;}
virtual bool toNativeQuery(Rcl::Db &db, void *, const string& stemlang);
protected:
SearchData m_sub;
SearchData *m_sub;
};
#endif // NOTNOW
} // Namespace Rcl
#endif /* _SEARCHDATA_H_INCLUDED_ */