Remove old commented-out version of the printing code.
[SXSI/XMLTree.git] / xml-tree.hpp
index debabe9..3ac5813 100644 (file)
@@ -3,7 +3,6 @@
 
 
 #include <cstdint>
-#include <unordered_set>
 #include <unordered_map>
 #include <bp/bp.h>
 #include <bp/bp-darray.h>
@@ -51,7 +50,7 @@ public:
   inline uint32_t num_tags() const;
   inline uint32_t subtree_size(node_t) const;
   inline uint32_t subtree_tags(node_t, tag_t) const;
-  uint32_t subtree_elements(node_t) const;
+  inline uint32_t subtree_elements(node_t, tag_t*) const;
   uint32_t num_children(node_t) const;
   uint32_t child_pos(node_t) const;
 
@@ -63,6 +62,7 @@ public:
   bool is_child(node_t, node_t) const;
   inline bool is_first_child(node_t) const;
   inline bool is_nil(node_t) const;
+  inline bool is_open(node_t) const;
 
   uint32_t depth(node_t) const;
   uint32_t preorder(node_t) const;
@@ -83,16 +83,16 @@ public:
   inline node_t prev_sibling(node_t) const;
   inline node_t first_element(node_t) const;
   inline node_t next_element(node_t) const;
+  inline node_t tagged_next_close(node_t, tag_t) const;
   inline node_t tagged_next(node_t, tag_t) const;
   inline node_t tagged_descendant(node_t, tag_t) const;
   inline node_t tagged_following_before(node_t, tag_t, node_t) const;
   inline node_t tagged_child(node_t, tag_t) const;
   inline node_t tagged_sibling(node_t, tag_t) const;
-  node_t select_child(node_t, std::unordered_set<tag_t>*) const;
-  node_t select_descendant(node_t, std::unordered_set<tag_t>*) const;
-  node_t select_sibling(node_t, std::unordered_set<tag_t>*) const;
-  node_t select_following_before (node_t,
-                                  std::unordered_set<tag_t>*, node_t) const;
+  node_t select_child(node_t, tag_t*) const;
+  inline node_t select_descendant(node_t, tag_t*) const;
+  node_t select_sibling(node_t, tag_t*) const;
+  inline node_t select_following_before (node_t, tag_t*, node_t) const;
   inline node_t closing(node_t) const;
 
   //Text functions
@@ -108,6 +108,9 @@ public:
   SXSI::TextCollection::document_result contains(uchar const *s) const;
   SXSI::TextCollection::document_result less_than(uchar const *s) const;
 
+
+  bool naive_contains(node_t, uchar const *s) const;
+
   //I/O functions
   void save(int, char*);
   static xml_tree* load(int, char*, bool, int);
@@ -128,7 +131,7 @@ private:
   //Parenthesis sequence
   bp *par;
   //tag sequence
-  static_sequence *tags;
+  std::vector<static_bitsequence_sdarray*> tags;
   uint32_t *tag_seq;
   uint32_t tag_seq_len;
   uint32_t bits_per_tag;