2 ** Data structure used to store sparse styles.
4 // Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
5 // The License.txt file describes the conditions under which this software may be distributed.
7 /// Styling buffer using one element for each run rather than using
13 namespace Scintilla::Internal
{
15 // Return for RunStyles::FillRange reports if anything was changed and the
16 // range that was changed. This may be trimmed from the requested range
17 // when some of the requested range already had the requested value.
18 template <typename DISTANCE
>
25 template <typename DISTANCE
, typename STYLE
>
28 Partitioning
<DISTANCE
> starts
;
29 SplitVector
<STYLE
> styles
;
30 DISTANCE
RunFromPosition(DISTANCE position
) const noexcept
;
31 DISTANCE
SplitRun(DISTANCE position
);
32 void RemoveRun(DISTANCE run
);
33 void RemoveRunIfEmpty(DISTANCE run
);
34 void RemoveRunIfSameAsPrevious(DISTANCE run
);
37 DISTANCE
Length() const noexcept
;
38 STYLE
ValueAt(DISTANCE position
) const noexcept
;
39 DISTANCE
FindNextChange(DISTANCE position
, DISTANCE end
) const noexcept
;
40 DISTANCE
StartRun(DISTANCE position
) const noexcept
;
41 DISTANCE
EndRun(DISTANCE position
) const noexcept
;
42 // Returns changed=true if some values may have changed
43 FillResult
<DISTANCE
> FillRange(DISTANCE position
, STYLE value
, DISTANCE fillLength
);
44 void SetValueAt(DISTANCE position
, STYLE value
);
45 void InsertSpace(DISTANCE position
, DISTANCE insertLength
);
47 void DeleteRange(DISTANCE position
, DISTANCE deleteLength
);
48 DISTANCE
Runs() const noexcept
;
49 bool AllSame() const noexcept
;
50 bool AllSameAs(STYLE value
) const noexcept
;
51 DISTANCE
Find(STYLE value
, DISTANCE start
) const noexcept
;