git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/xpathcomp@181
3cdefd35-fc62-479d-8e8d-
bae585ffb9ca
delete (txt);
CAMLreturn (str);
}
+
+extern "C" CAMLprim value caml_text_collection_get_cached_text(value tree, value id){
+ CAMLparam2(tree,id);
+ CAMLlocal1(str);
+ const char* txt = (const char*) XMLTREE(tree)->GetCachedText((DocID) Int_val(id));
+ str = caml_copy_string(txt);
+ CAMLreturn (str);
+}
+
+
extern "C" CAMLprim value caml_text_collection_empty_text(value tree,value id){
CAMLparam2(tree,id);
CAMLreturn ( Val_int((XMLTREE(tree))->EmptyText((DocID) Int_val(id))));
let nil = nullt ()
external get_text : t -> [`Text] node -> string = "caml_text_collection_get_text"
- let get_text t n =
+(* let get_text t n =
if equal nil n then ""
else get_text t n
+*)
external is_empty : t -> [`Text ] node -> bool = "caml_text_collection_empty_text"
let is_empty t n =
(equal nil n) || is_empty t n
+ external get_cached_text : t -> [`Text ] node -> string = "caml_text_collection_get_cached_text"
+
+ let get_text t n =
+ if (equal nil n) || is_empty t n then ""
+ else get_cached_text t n
+
external is_contains : t -> string -> bool = "caml_text_collection_is_contains"
external count_contains : t -> string -> int = "caml_text_collection_count_contains"
external contains : t -> string -> [`Text ] node array = "caml_text_collection_contains"