okteta
#include <bytearraytablecursor.h>
Protected Member Functions | |
void | stepToEnd () |
Detailed Description
navigates through the buffer in an abstract way, based on the layout
The cursor is allowed to access every coord that has content as described in the layout. It holds the coord of the actual position and the according index in the data array.
To enable the cursor to be placed behind the last position in a line (e.g, to mark all data in the line without placing the cursor to the beginning of the next line) there is a flag mBehind that should be read as that the real index the cursor is at is the current one + 1 (as returned by realIndex())
For appending new data to the buffer there is also the need to be able to place the cursor at a position behind the last byte. This can be enabled by calling setAppendPosEnabled(true). If the cursor is placed to this position it gets the (real) index of the last byte + 1. As this index does not point to an existing byte validIndex() returns -1. Check for atAppendPos() to see whether cursor is at this position.
If the buffer is empty there is no navigation possible, of course. The cursor will be placed to coord 0/0 with index 1, mBehind=false.
Definition at line 60 of file bytearraytablecursor.h.
Constructor & Destructor Documentation
|
explicit |
Definition at line 34 of file bytearraytablecursor.cpp.
Okteta::ByteArrayTableCursor::~ByteArrayTableCursor | ( | ) |
Definition at line 407 of file bytearraytablecursor.cpp.
Member Function Documentation
void Okteta::ByteArrayTableCursor::adaptToChanges | ( | const ArrayChangeMetricsList & | changeList, |
Size | oldLength | ||
) |
Definition at line 347 of file bytearraytablecursor.cpp.
|
inline |
Default is false.
Definition at line 176 of file bytearraytablecursor.h.
bool Okteta::ByteArrayTableCursor::atAppendPos | ( | ) | const |
could only be true in InsertMode: Cursor is behind the last byte
Definition at line 340 of file bytearraytablecursor.cpp.
bool Okteta::ByteArrayTableCursor::atEnd | ( | ) | const |
Definition at line 339 of file bytearraytablecursor.cpp.
bool Okteta::ByteArrayTableCursor::atLineEnd | ( | ) | const |
Definition at line 344 of file bytearraytablecursor.cpp.
bool Okteta::ByteArrayTableCursor::atLineStart | ( | ) | const |
Definition at line 343 of file bytearraytablecursor.cpp.
bool Okteta::ByteArrayTableCursor::atStart | ( | ) | const |
Definition at line 338 of file bytearraytablecursor.cpp.
|
inline |
the actual coord
Definition at line 173 of file bytearraytablecursor.h.
void Okteta::ByteArrayTableCursor::gotoCCoord | ( | const Coord & | coord | ) |
Definition at line 231 of file bytearraytablecursor.cpp.
void Okteta::ByteArrayTableCursor::gotoCIndex | ( | Address | index | ) |
Definition at line 218 of file bytearraytablecursor.cpp.
void Okteta::ByteArrayTableCursor::gotoCoord | ( | const Coord & | coord | ) |
Definition at line 280 of file bytearraytablecursor.cpp.
void Okteta::ByteArrayTableCursor::gotoDown | ( | ) |
Definition at line 159 of file bytearraytablecursor.cpp.
void Okteta::ByteArrayTableCursor::gotoEnd | ( | ) |
sets the index behind the last index.
If appendPosEnabled is true, this will be the last index + 1, otherwise it will be the last index and the flag behind.
Definition at line 203 of file bytearraytablecursor.cpp.
void Okteta::ByteArrayTableCursor::gotoIndex | ( | Address | index | ) |
Definition at line 260 of file bytearraytablecursor.cpp.
void Okteta::ByteArrayTableCursor::gotoLineEnd | ( | ) |
Definition at line 182 of file bytearraytablecursor.cpp.
void Okteta::ByteArrayTableCursor::gotoLineStart | ( | ) |
Definition at line 173 of file bytearraytablecursor.cpp.
void Okteta::ByteArrayTableCursor::gotoNextByte | ( | ) |
Definition at line 102 of file bytearraytablecursor.cpp.
void Okteta::ByteArrayTableCursor::gotoNextByte | ( | Size | indexSteps | ) |
Definition at line 117 of file bytearraytablecursor.cpp.
void Okteta::ByteArrayTableCursor::gotoPageDown | ( | ) |
Definition at line 315 of file bytearraytablecursor.cpp.
void Okteta::ByteArrayTableCursor::gotoPageUp | ( | ) |
Definition at line 295 of file bytearraytablecursor.cpp.
void Okteta::ByteArrayTableCursor::gotoPreviousByte | ( | ) |
Definition at line 70 of file bytearraytablecursor.cpp.
void Okteta::ByteArrayTableCursor::gotoPreviousByte | ( | Size | indexSteps | ) |
Definition at line 82 of file bytearraytablecursor.cpp.
void Okteta::ByteArrayTableCursor::gotoRealIndex | ( | ) |
sets the index to the real index, i.e.
if "behind" one index, sets it to the next. Undefined if the real index is invalid, or on the append pos if not allowed.
Definition at line 268 of file bytearraytablecursor.cpp.
void Okteta::ByteArrayTableCursor::gotoStart | ( | ) |
Definition at line 195 of file bytearraytablecursor.cpp.
void Okteta::ByteArrayTableCursor::gotoUp | ( | ) |
Definition at line 133 of file bytearraytablecursor.cpp.
|
inline |
the index that is drawn at the actual coord
Definition at line 170 of file bytearraytablecursor.h.
Address Okteta::ByteArrayTableCursor::indexAtLineEnd | ( | ) | const |
returns the index at the end of the cursor's line
Definition at line 335 of file bytearraytablecursor.cpp.
Address Okteta::ByteArrayTableCursor::indexAtLineStart | ( | ) | const |
returns the index at the start of the cursor's line
Definition at line 334 of file bytearraytablecursor.cpp.
|
inline |
true if the cursor is located to the right of the actual coord but still shown at the coord
Definition at line 174 of file bytearraytablecursor.h.
|
inline |
the line of the actual coord
Definition at line 172 of file bytearraytablecursor.h.
|
inline |
the pos of the actual coord
Definition at line 171 of file bytearraytablecursor.h.
|
inline |
returns the real index.
That is if the cursor is tagged as "behind" the current index it's real index is the next one. Attention: this could be outside the data's range if the cursor is behind the last byte!
Definition at line 175 of file bytearraytablecursor.h.
void Okteta::ByteArrayTableCursor::setAppendPosEnabled | ( | bool | appendPosEnabled = true | ) |
Definition at line 43 of file bytearraytablecursor.cpp.
|
inline |
puts the cursor behind the actual position if it isn't already
Definition at line 178 of file bytearraytablecursor.h.
|
protected |
if newpos allowed steps at a coord behind the last existing or, if that is at a line end, behind the line does not check for empty content!
Definition at line 247 of file bytearraytablecursor.cpp.
void Okteta::ByteArrayTableCursor::updateCoord | ( | ) |
Definition at line 288 of file bytearraytablecursor.cpp.
Address Okteta::ByteArrayTableCursor::validIndex | ( | ) | const |
returns the true index if it is valid index that is it is inside the data's range.
Otherwise -1 is returned
Definition at line 329 of file bytearraytablecursor.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:13 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.