MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / append

Method append

app/src/UI/Widgets/Terminal.cpp:1199–1249  ·  view source on GitHub ↗

* @brief Appends data to the terminal, processing it through the VT-100 state machine. */

Source from the content-addressed store, hash-verified

1197 * @brief Appends data to the terminal, processing it through the VT-100 state machine.
1198 */
1199void Widgets::Terminal::append(const QString& data)
1200{
1201 QString text;
1202 text.reserve(data.size());
1203
1204 int pos = 0;
1205 const int len = data.size();
1206
1207 while (pos < len) {
1208 if (m_state == Text) [[likely]] {
1209 const int runStart = pos;
1210 pos = scanPrintableRun(data, pos);
1211
1212 if (pos > runStart)
1213 text.append(QStringView(data).mid(runStart, pos - runStart));
1214
1215 if (pos < len && m_state == Text) {
1216 processText(data[pos], text);
1217 ++pos;
1218 }
1219
1220 continue;
1221 }
1222
1223 const auto byte = data[pos];
1224 switch (m_state) {
1225 case Escape:
1226 processEscape(byte, text);
1227 break;
1228 case Format:
1229 processFormat(byte, text);
1230 break;
1231 case ResetFont:
1232 processResetFont(byte, text);
1233 break;
1234 case OSC:
1235 processOsc(byte);
1236 break;
1237 case IgnoreSeq:
1238 processIgnoreSeq(byte);
1239 break;
1240 default:
1241 break;
1242 }
1243
1244 ++pos;
1245 }
1246
1247 appendString(text);
1248 m_stateChanged = true;
1249}
1250
1251//--------------------------------------------------------------------------------------------------
1252// Buffer management

Callers 15

taskbarWindowIdsMethod · 0.45
nextActiveWindowMethod · 0.45
startFocusCycleMethod · 0.45
collectGroupWidgetIdsMethod · 0.45
searchResultsMethod · 0.45
allWidgetsMethod · 0.45
workspaceModelMethod · 0.45
buildWorkspaceTreeLevelFunction · 0.45
flattenSwitcherNodesFunction · 0.45
workspaceWidgetIdsMethod · 0.45
createWidgetMethod · 0.45
widgetIdsByTypeMethod · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected