/[hyperestraier_wrappers]/trunk/perl/HyperEstraierWrapper.cpp
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/perl/HyperEstraierWrapper.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 11 by dpavlin, Thu Sep 8 21:22:10 2005 UTC revision 12 by dpavlin, Thu Sep 8 22:51:10 2005 UTC
# Line 455  namespace estraier { Line 455  namespace estraier {
455                  return vs;                  return vs;
456          }          }
457    
458          class NodeDocument {          class ResultDocument {
         private:  
                 ESTRESDOC *rdoc;  
459          public:          public:
460                  NodeDocument(ESTNODERES *nres, int index) {                  ESTRESDOC *rdoc;
461                          rdoc = est_noderes_get_doc(nres, index);                  ResultDocument(ESTRESDOC *_rdoc) {
462                            rdoc = _rdoc;
463                  }                  }
464                  const char *uri(void) {                  const char *uri(void) {
465                          return est_resdoc_uri(rdoc);                          return est_resdoc_uri(rdoc);
# Line 486  namespace estraier { Line 485  namespace estraier {
485          private:          private:
486                  ESTNODERES *nres;                  ESTNODERES *nres;
487          public:          public:
488                  NodeRes(ESTNODE *node, ESTCOND *cond, int depth) {                  NodeRes(ESTNODE *node, Condition *cond, int depth) {
489                          nres = est_node_search(node, cond, depth);                          nres = est_node_search(node, cond->cond, depth);
490                  }                  }
491                  ~NodeRes() {                  ~NodeRes() {
492                          est_noderes_delete(nres);                          est_noderes_delete(nres);
# Line 505  namespace estraier { Line 504  namespace estraier {
504                  int doc_num(void) {                  int doc_num(void) {
505                          return est_noderes_doc_num(nres);                          return est_noderes_doc_num(nres);
506                  }                  }
507                  NodeDocument * get_doc(int index) {                  ResultDocument * get_doc(int index) {
508                          return new NodeDocument(nres, index);                          ESTRESDOC *rdoc = est_noderes_get_doc(nres, index);
509                            if (rdoc) {
510                                    return new ResultDocument(rdoc);
511                            } else {
512                                    throw IOError("wtf? no document?");
513                                    return NULL;
514                            }
515                  }                  }
516          };          };
517    
# Line 594  namespace estraier { Line 599  namespace estraier {
599                  double size(void) {                  double size(void) {
600                          return est_node_size(node);                          return est_node_size(node);
601                  }                  }
602                  NodeRes * search(ESTCOND *cond, int depth) {                  NodeRes * search(Condition *cond, int depth) {
603                          return new NodeRes(node, cond, depth);                          return new NodeRes(node, cond, depth);
604                  }                  }
605                  int set_user(const char *name, int mode) {                  int set_user(const char *name, int mode) {

Legend:
Removed from v.11  
changed lines
  Added in v.12

  ViewVC Help
Powered by ViewVC 1.1.26