Switch to unified view

a/src/query/docseq.h b/src/query/docseq.h
...
...
67
    Additional functionality like filtering/sorting can either be
67
    Additional functionality like filtering/sorting can either be
68
    obtained by stacking DocSequence objects (ie: sorting history), or
68
    obtained by stacking DocSequence objects (ie: sorting history), or
69
    by native capability (ex: docseqdb can sort and filter). The
69
    by native capability (ex: docseqdb can sort and filter). The
70
    implementation might be nicer by using more sophisticated c++ with
70
    implementation might be nicer by using more sophisticated c++ with
71
    multiple inheritance of sort and filter virtual interfaces, but
71
    multiple inheritance of sort and filter virtual interfaces, but
72
    the current one will have to do for now...
72
    the current one will have to do for now.
73
*/
73
*/
74
class DocSequence {
74
class DocSequence {
75
 public:
75
 public:
76
    DocSequence(const string &t) : m_title(t) {}
76
    DocSequence(const string &t) : m_title(t) {}
77
    virtual ~DocSequence() {}
77
    virtual ~DocSequence() {}
...
...
95
     *  sequences can compute a better value (ie: docseqdb) */
95
     *  sequences can compute a better value (ie: docseqdb) */
96
    virtual bool getAbstract(Rcl::Doc& doc, vector<string>& abs) {
96
    virtual bool getAbstract(Rcl::Doc& doc, vector<string>& abs) {
97
    abs.push_back(doc.meta[Rcl::Doc::keyabs]);
97
    abs.push_back(doc.meta[Rcl::Doc::keyabs]);
98
    return true;
98
    return true;
99
    }
99
    }
100
    virtual string getAbstract(Rcl::Doc& doc) {
101
  vector<string> v;
102
  getAbstract(doc, v);
103
  string abstract;
104
  for (vector<string>::const_iterator it = v.begin();
105
       it != v.end(); it++) {
106
      abstract += *it;
107
      abstract += "... ";
108
  }
109
  return abstract;
110
    }
111
    virtual bool getEnclosing(Rcl::Doc&, Rcl::Doc&) = 0;
100
    virtual bool getEnclosing(Rcl::Doc&, Rcl::Doc&) = 0;
112
101
113
    /** Get estimated total count in results */
102
    /** Get estimated total count in results */
114
    virtual int getResCnt() = 0;
103
    virtual int getResCnt() = 0;
115
104
...
...
166
    virtual bool getAbstract(Rcl::Doc& doc, vector<string>& abs) 
155
    virtual bool getAbstract(Rcl::Doc& doc, vector<string>& abs) 
167
    {
156
    {
168
    if (m_seq.isNull())
157
    if (m_seq.isNull())
169
        return false;
158
        return false;
170
    return m_seq->getAbstract(doc, abs);
159
    return m_seq->getAbstract(doc, abs);
171
    }
172
    virtual string getAbstract(Rcl::Doc& doc)
173
    {
174
  if (m_seq.isNull())
175
      return "";
176
  return m_seq->getAbstract(doc);
177
    }
160
    }
178
    virtual string getDescription() 
161
    virtual string getDescription() 
179
    {
162
    {
180
    if (m_seq.isNull())
163
    if (m_seq.isNull())
181
        return "";
164
        return "";