MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / findVariable

Method findVariable

src/data/EelParser.cpp:260–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258// --- Private members
259
260QString EELParser::findVariable(QString key,
261 EELPropertyType type)
262{
263 if (type == EELPropertyType::NumberRange || type == EELPropertyType::List)
264 {
265 QRegularExpression re(QString(R"(%1\s*=\s*(?<val>-?\d+\.?\d*)\s*;)").arg(key));
266
267 for (const auto &line : container.code.split("\n"))
268 {
269 auto matchIterator = re.globalMatch(line);
270
271 if (matchIterator.hasNext())
272 {
273 auto match = matchIterator.next();
274 return match.captured("val");
275 }
276 }
277 }
278
279 Log::warning(QString("Unable to find a supported variable definition of '%1' in script '%2'").arg(key).arg(getDescription()));
280 return NORESULT;
281}
282
283bool EELParser::replaceVariable(QString key,
284 QString value,

Callers

nothing calls this directly

Calls 3

QStringClass · 0.50
splitMethod · 0.45
hasNextMethod · 0.45

Tested by

no test coverage detected