add const BufferIterator::Buffer& buffer() method

This commit is contained in:
Maxime Coste 2011-09-02 18:35:22 +00:00
parent 19123186d7
commit 39f12a1766
2 changed files with 8 additions and 0 deletions

View File

@ -19,6 +19,12 @@ BufferIterator::BufferIterator(const Buffer& buffer, BufferPos position) : m_buf
{ {
} }
const Buffer& BufferIterator::buffer() const
{
assert(m_buffer);
return *m_buffer;
}
BufferIterator& BufferIterator::operator=(const BufferIterator& iterator) BufferIterator& BufferIterator::operator=(const BufferIterator& iterator)
{ {
m_buffer == iterator.m_buffer; m_buffer == iterator.m_buffer;

View File

@ -55,6 +55,8 @@ public:
bool is_begin() const; bool is_begin() const;
bool is_end() const; bool is_end() const;
const Buffer& buffer() const;
private: private:
const Buffer* m_buffer; const Buffer* m_buffer;
BufferPos m_position; BufferPos m_position;