TextBufferRange

A mutable random-access range of AnsiChars that belongs to a certain bounded area (TextBufferBound) within a TextBuffer.

You can use this range to go over a certain rectangular area of characters using the range API; directly index into this rectangular area, and directly modify elements in this rectangular range.

Reading: Since this is a random-access range, you can either use the normal foreach, popFront + front combo, and you can directly index into this range.

Note that popping the elements from this range does affect indexing. So if you popFront, then [0] is now what was previous [1], and so on.

Writing: This range implements opIndexAssign for both char and AnsiChar parameters.

You can either index in a 1D way (using 1 index), or a 2D ways (using 2 indicies, not implemented yet).

So if you wanted to set the 7th index to a certain character, then you could do range[6] = '0'.

You could also do it like so - range[6] = AnsiChar(...params here)

Members

Aliases

opDollar
alias opDollar = length
Undocumented in source.

Functions

popFront
void popFront()

Properties

bounds
TextBufferBounds bounds [@property getter]

The bounds that this range are constrained to.

empty
bool empty [@property getter]
front
AnsiChar front [@property getter]
length
size_t length [@property getter]

How many elements are left in the range.

opIndex
size_t opIndex [@property setter]
opIndexAssign
void opIndexAssign(char ch, size_t i)
void opIndexAssign(AnsiChar ch, size_t i)

Sets the character value of the AnsiChar at index i.

progressedLength
size_t progressedLength [@property getter]

Effectively how many times popFront has been called.

See Also

TextBufferWriter.getArea

Meta