summaryrefslogtreecommitdiff
path: root/src/dynamic_buffer_iterator.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/dynamic_buffer_iterator.hh')
-rw-r--r--src/dynamic_buffer_iterator.hh35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/dynamic_buffer_iterator.hh b/src/dynamic_buffer_iterator.hh
new file mode 100644
index 00000000..17e74485
--- /dev/null
+++ b/src/dynamic_buffer_iterator.hh
@@ -0,0 +1,35 @@
+#ifndef dynamic_buffer_iterator_hh_INCLUDED
+#define dynamic_buffer_iterator_hh_INCLUDED
+
+#include "buffer.hh"
+
+namespace Kakoune
+{
+
+class DynamicBufferIterator : public BufferIterator,
+ public BufferModificationListener
+{
+public:
+ DynamicBufferIterator() : BufferIterator() {}
+ DynamicBufferIterator(const Buffer& buffer, BufferPos position);
+ DynamicBufferIterator(const BufferIterator& other);
+ DynamicBufferIterator(const DynamicBufferIterator& other)
+ : BufferIterator(other) { register_ifp(); }
+
+ DynamicBufferIterator(DynamicBufferIterator&& other);
+ DynamicBufferIterator& operator=(const BufferIterator& other);
+ DynamicBufferIterator& operator=(const DynamicBufferIterator& other)
+ { return this->operator= (static_cast<const BufferIterator&>(other)); }
+ ~DynamicBufferIterator();
+
+ void on_modification(const BufferModification& modification);
+
+private:
+ void register_ifp();
+ void unregister_ifn();
+};
+
+
+}
+
+#endif // dynamic_buffer_iterator_hh_INCLUDED