MCPcopy Create free account
hub / github.com/MeisApps/pcbu-desktop / GetResource

Method GetResource

desktop/src/utils/ResourceHelper.cpp:5–11  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <QFile>
4
5std::vector<uint8_t> ResourceHelper::GetResource(const std::string &url) {
6 auto file = QFile(QString::fromUtf8(url));
7 if(!file.open(QIODevice::ReadOnly))
8 throw std::runtime_error(fmt::format("Failed to open resource '{}'.", url));
9 auto data = file.readAll();
10 return {data.begin(), data.end()};
11}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected