expose line iteration in Buffer API
This commit is contained in:
parent
fdcba81a3d
commit
6d6988c027
@ -10,8 +10,20 @@ class Buffer
|
||||
public:
|
||||
bool load_from_file(const char * filename);
|
||||
|
||||
typedef std::shared_ptr<Text> LineType;
|
||||
typedef std::list<LineType> LinesType;
|
||||
|
||||
auto begin() { return m_lines.begin(); }
|
||||
auto end() { return m_lines.end(); }
|
||||
auto cbegin() const { return m_lines.cbegin(); }
|
||||
auto cend() const { return m_lines.cend(); }
|
||||
auto rbegin() { return m_lines.rbegin(); }
|
||||
auto rend() { return m_lines.rend(); }
|
||||
auto crbegin() const { return m_lines.crbegin(); }
|
||||
auto crend() const { return m_lines.crend(); }
|
||||
|
||||
protected:
|
||||
std::list<std::shared_ptr<Text>> m_lines;
|
||||
LinesType m_lines;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user