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

Function readResource

app/src/AI/ContextBuilder.cpp:24–35  ·  view source on GitHub ↗

* @brief Reads a Qt resource into a QString, returning empty on failure. */

Source from the content-addressed store, hash-verified

22 * @brief Reads a Qt resource into a QString, returning empty on failure.
23 */
24static QString readResource(const QString& path)
25{
26 QFile file(path);
27 if (!file.open(QIODevice::ReadOnly)) {
28 qCWarning(AI::serialStudioAI) << "Resource not readable:" << path;
29 return {};
30 }
31
32 const auto data = file.readAll();
33 file.close();
34 return QString::fromUtf8(data);
35}
36
37/**
38 * @brief Neutralizes any forged <untrusted> delimiter inside untrusted payload text.

Callers 5

scriptingDocForMethod · 0.85
skillBodyMethod · 0.85
scriptingDocsBlockMethod · 0.85
buildHtmlMethod · 0.85
buildCoverLogoMarkupMethod · 0.85

Calls 2

openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected