Add a length method to AtomContent

This commit is contained in:
Maxime Coste 2012-09-30 16:21:20 +02:00
parent 5b6cb500fc
commit 6cd5d80757

View File

@ -57,6 +57,18 @@ public:
} }
} }
CharCount length() const
{
switch (m_type)
{
case BufferRange:
return m_end - m_begin;
case Text:
case ReplacedBufferRange:
return m_text.length();
}
}
BufferIterator& begin() BufferIterator& begin()
{ {
assert(has_buffer_range()); assert(has_buffer_range());