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); |
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); |
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 |
|
|
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) { |