Buffer: add line_count method
This commit is contained in:
parent
2efa120612
commit
948443a077
|
@ -233,6 +233,11 @@ BufferSize Buffer::length() const
|
|||
return m_content.size();
|
||||
}
|
||||
|
||||
BufferSize Buffer::line_count() const
|
||||
{
|
||||
return m_lines.size();
|
||||
}
|
||||
|
||||
BufferString Buffer::string(const BufferIterator& begin, const BufferIterator& end) const
|
||||
{
|
||||
return m_content.substr(begin.m_position, end - begin);
|
||||
|
|
|
@ -90,6 +90,7 @@ public:
|
|||
BufferIterator begin() const;
|
||||
BufferIterator end() const;
|
||||
BufferSize length() const;
|
||||
BufferSize line_count() const;
|
||||
|
||||
BufferIterator iterator_at(const BufferCoord& line_and_column) const;
|
||||
BufferCoord line_and_column_at(const BufferIterator& iterator) const;
|
||||
|
|
Loading…
Reference in New Issue
Block a user