edbee - Qt Editor Library
|
This class implements the vector for storing the line numbers at certain offsets/ The class allows the 'gap' position to contain a delta offset. Which means that. More...
#include <lineoffsetvector.h>
Public Member Functions | |
LineOffsetVector () | |
a structure to describe the line change that happend More... | |
void | applyChange (TextBufferChange change) |
int | at (int idx) const |
this method returns the line offset at the given line offset More... | |
int | length () const |
int | findLineFromOffset (int offset) |
this method searches the line from the given offset More... | |
int | offsetDelta () |
int | offsetDeltaIndex () |
void | appendOffset (int offset) |
This method appends an offset to the end of the list It simply applies the current offsetDelta because it will always be AFTER the current offsetDelta. More... | |
GapVector< int > | offsetList () |
QString | toUnitTestString () |
This method returns the offset to string. More... | |
void | initForUnitTesting (int offsetDelta, int offsetDeltaIndex,...) |
initializes the construct for unit testing More... | |
Protected Member Functions | |
int | searchOffsetIgnoringOffsetDelta (int offset, int org_start, int org_end) |
This method returns the line from the start position. This method uses a binary search. Warning this method uses RAW values from the offsetList it does NOT take in account the offsetDelta. More... | |
void | moveDeltaToIndex (int index) |
This method moves the delta to the given index. More... | |
void | changeOffsetDelta (int index, int delta) |
This method moves the offset delta to the given location. More... | |
Friends | |
class | LineOffsetVectorTest |
This class implements the vector for storing the line numbers at certain offsets/ The class allows the 'gap' position to contain a delta offset. Which means that.
all offsets after the gap are increased with the offsetDelta when searched. Inserting/deleting text this way usually only results in the changine of the offset delta. Which means speeeed
The line offset pointed at by each index is the first character in the given line.
edbee::LineOffsetVector::LineOffsetVector | ( | ) |
a structure to describe the line change that happend
void edbee::LineOffsetVector::appendOffset | ( | int | offset | ) |
This method appends an offset to the end of the list It simply applies the current offsetDelta because it will always be AFTER the current offsetDelta.
void edbee::LineOffsetVector::applyChange | ( | TextBufferChange | change | ) |
int edbee::LineOffsetVector::at | ( | int | idx | ) | const |
this method returns the line offset at the given line offset
|
protected |
This method moves the offset delta to the given location.
int edbee::LineOffsetVector::findLineFromOffset | ( | int | offset | ) |
this method searches the line from the given offset
void edbee::LineOffsetVector::initForUnitTesting | ( | int | offsetDelta, |
int | offsetDeltaIndex, | ||
... | |||
) |
initializes the construct for unit testing
offsetDelta | the offsetDelta to use |
offsetDeltaIndex | the offsetDeltaIndex to use |
a | list of integer offsets. Close the list with -1 !!! |
int edbee::LineOffsetVector::length | ( | ) | const |
|
protected |
This method moves the delta to the given index.
|
inline |
|
inline |
|
protected |
This method returns the line from the start position. This method uses a binary search. Warning this method uses RAW values from the offsetList it does NOT take in account the offsetDelta.
QString edbee::LineOffsetVector::toUnitTestString | ( | ) |
This method returns the offset to string.
|
friend |