summaryrefslogtreecommitdiff
path: root/src/support/suffix_tree.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/support/suffix_tree.h')
-rw-r--r--src/support/suffix_tree.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/support/suffix_tree.h b/src/support/suffix_tree.h
index 4ce61767d..6aa9c2f20 100644
--- a/src/support/suffix_tree.h
+++ b/src/support/suffix_tree.h
@@ -38,6 +38,7 @@
#include "llvm/Support/Allocator.h"
#include <cassert>
#include <cstddef>
+#include <ostream>
#include <vector>
#include "support/suffix_tree_node.h"
@@ -64,6 +65,19 @@ public:
}
};
+ friend std::ostream& operator<<(std::ostream& os,
+ RepeatedSubstring substring) {
+ os << "SuffixTree::RepeatedSubstring{" << substring.Length
+ << "u, (std::vector<unsigned>{";
+ for (unsigned idx = 0; idx < substring.StartIndices.size(); idx++) {
+ os << substring.StartIndices[idx];
+ if (idx != substring.StartIndices.size() - 1) {
+ os << ", ";
+ }
+ }
+ return os << "})}";
+ }
+
private:
/// Maintains internal nodes in the tree.
SpecificBumpPtrAllocator<SuffixTreeInternalNode> InternalNodeAllocator;