Home modules.gotpike.org
Username: Password: [Create Account]
[Forgot Password?]
Return to module

File Contents

Contents of /Public_Xapian-1.5/PikeMatchDeciderProxy.cc:

class PikeMatchDeciderProxy: public Xapian::MatchDecider
{
  struct svalue * fx;

  public:
  PikeMatchDeciderProxy(struct svalue * func)
  {
    fx = func;
  }

  virtual bool operator()(const Xapian::Document& doc) const 
  {
    struct object * o;
    Xapian::Document d;
    int i;
    bool b;

    o = fast_clone_object(Document_program);
    d = (doc);
    OBJ2_DOCUMENT(o)->object_data->document = &d;

    push_object(o);

    apply_svalue(fx, 1);
    i = Pike_sp[-1].u.integer;
    pop_stack();
    if(i == 0) b = false;
    else b = true;

    return b;
  }
};

gotpike.org | Copyright © 2004 - 2011 | Pike is a trademark of Department of Computer and Information Science, Linköping University