diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-12-12 13:45:08 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-12-12 13:45:08 +0000 |
| commit | bd80cf0404b89b531312ac86e7868f8fd18052d5 (patch) | |
| tree | 4f3898dca87e362ef5451195483ddddb534a7331 /src/display_buffer.hh | |
| parent | 277b02eee6cb0037d2ecce46d1f2a455dfb0b001 (diff) | |
Add DisplayAtom::check_invariant method
Diffstat (limited to 'src/display_buffer.hh')
| -rw-r--r-- | src/display_buffer.hh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/display_buffer.hh b/src/display_buffer.hh index 92896ee9..8ea88cec 100644 --- a/src/display_buffer.hh +++ b/src/display_buffer.hh @@ -35,11 +35,13 @@ public: enum Type { BufferRange, ReplacedBufferRange, Text }; DisplayAtom(const Buffer& buffer, BufferCoord begin, BufferCoord end) - : m_type(BufferRange), m_buffer(&buffer), m_begin(begin), m_end(end) {} + : m_type(BufferRange), m_buffer(&buffer), m_begin(begin), m_end(end) + { check_invariant(); } DisplayAtom(String str, ColorPair colors = { Colors::Default, Colors::Default }, Attribute attribute = Normal) - : m_type(Text), m_text(std::move(str)), colors(colors), attribute(attribute) {} + : m_type(Text), m_text(std::move(str)), colors(colors), attribute(attribute) + { check_invariant(); } String content() const { @@ -99,6 +101,7 @@ public: void trim_begin(CharCount count); void trim_end(CharCount count); + void check_invariant() const; public: ColorPair colors = {Colors::Default, Colors::Default}; Attribute attribute = Normal; |
