13#ifndef BYTE_VIEW_TEXT_CELLS_H
14#define BYTE_VIEW_TEXT_CELLS_H
35class ByteViewTextCells
121 Cell singleByteCell(
int offset)
const;
126 void appendRun(
const QVector<CodePoint> &run);
129 void appendCluster(
const QVector<CodePoint> &run,
int first,
int last);
132 void appendCodePoints(
const QVector<CodePoint> &run,
int first,
int last);
134 void appendCell(
int start,
int length,
CellKind kind,
const QString &text);
135 void appendDotCell(
int start,
int length,
CellKind kind);
137 static bool isDisplayable(uint32_t uc);
138 static bool isMark(uint32_t uc);
139 static QString textFor(
const QVector<CodePoint> &run,
int first,
int last);
143 QVector<StoredCell> cells_;
Encoding
Character encoding of the data.
Definition byte_view_text_cells.h:39
@ Ascii
Definition byte_view_text_cells.h:40
@ Ebcdic
Definition byte_view_text_cells.h:41
@ Utf8
Definition byte_view_text_cells.h:42
static const int max_cell_bytes
Longest run of bytes kept as a single cell.
Definition byte_view_text_cells.h:66
void decode(const QByteArray &data, Encoding encoding)
Replace the cells with a decoding of data.
Definition byte_view_text_cells.cpp:34
CellKind
How a cell is displayed.
Definition byte_view_text_cells.h:46
@ Invalid
Definition byte_view_text_cells.h:49
@ Printable
Definition byte_view_text_cells.h:47
@ NonPrintable
Definition byte_view_text_cells.h:48
void clear()
Remove all cells.
Definition byte_view_text_cells.cpp:45
int cellIndexForByte(int offset) const
Return the index of the cell that contains offset.
Definition byte_view_text_cells.cpp:75
Cell cellAt(int cell_index) const
Return the cell at cell_index.
Definition byte_view_text_cells.cpp:60
int cellCount() const
Definition byte_view_text_cells.cpp:52
bool cellForByte(int offset, Cell &cell) const
Return the cell that contains offset.
Definition byte_view_text_cells.cpp:90
One displayed unit of text and the bytes it stands for.
Definition byte_view_text_cells.h:53
CellKind kind
Definition byte_view_text_cells.h:56
int start
Definition byte_view_text_cells.h:54
int length
Definition byte_view_text_cells.h:55
QString text
Definition byte_view_text_cells.h:57