MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / contextPasteCSV

Method contextPasteCSV

pcsx2-qt/Debugger/Breakpoints/BreakpointView.cpp:146–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146void BreakpointView::contextPasteCSV()
147{
148 QString csv = QGuiApplication::clipboard()->text();
149 // Skip header
150 csv = csv.mid(csv.indexOf('\n') + 1);
151
152 for (const QString& line : csv.split('\n'))
153 {
154 QStringList fields;
155 // In order to handle text with commas in them we must wrap values in quotes to mark
156 // where a value starts and end so that text commas aren't identified as delimiters.
157 // So matches each quote pair, parse it out, and removes the quotes to get the value.
158 QRegularExpression eachQuotePair(R"("([^"]|\\.)*")");
159 QRegularExpressionMatchIterator it = eachQuotePair.globalMatch(line);
160 while (it.hasNext())
161 {
162 QRegularExpressionMatch match = it.next();
163 QString matchedValue = match.captured(0);
164 fields << matchedValue.mid(1, matchedValue.length() - 2);
165 }
166 m_model->loadBreakpointFromFieldList(fields);
167 }
168}
169
170void BreakpointView::saveBreakpointsToDebuggerSettings()
171{

Callers

nothing calls this directly

Calls 5

splitMethod · 0.80
hasNextMethod · 0.80
nextMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected