summaryrefslogtreecommitdiff
path: root/ext/spl/internal/seekableiterator.inc
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/internal/seekableiterator.inc')
-rwxr-xr-xext/spl/internal/seekableiterator.inc29
1 files changed, 29 insertions, 0 deletions
diff --git a/ext/spl/internal/seekableiterator.inc b/ext/spl/internal/seekableiterator.inc
new file mode 100755
index 0000000000..3012155771
--- /dev/null
+++ b/ext/spl/internal/seekableiterator.inc
@@ -0,0 +1,29 @@
+<?php
+
+/** \brief seekable iterator
+ *
+ * Turns a normal iterator ino a seekable iterator. When there is a way
+ * to seek on an iterator LimitIterator can use this to efficiently rewind
+ * to offset.
+ */
+interface SeekableIterator implements Iterator
+{
+ /** Seek to an absolute position
+ *
+ * \param $index position to seek to
+ * \return void
+ *
+ * \note The method should throw an exception if it is not possible to
+ * seek to the given position.
+ */
+ function seek($index);
+/* $this->rewind();
+ $position = 0;
+ while($position < $index && $this->valid()) {
+ $this->next();
+ $position++;
+ }
+ }*/
+}
+
+?> \ No newline at end of file