MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / extractFirstMatchingMagic

Method extractFirstMatchingMagic

src/core/CabExtractor.cpp:199–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199bool CabExtractor::extractFirstMatchingMagic(const QByteArray& cabBytes,
200 const QByteArray& magic,
201 QByteArray& out)
202{
203 out.clear();
204 QList<QPair<QString, QByteArray>> all;
205 if (!extractAll(cabBytes, all))
206 return false;
207 for (auto& [name, data] : all) {
208 if (data.startsWith(magic)) {
209 out = std::move(data);
210 return true;
211 }
212 }
213 m_lastError = "no file in cab matched the requested magic";
214 return false;
215}
216
217} // namespace AetherSDR

Callers 2

extractFromMsiMethod · 0.80
mainFunction · 0.80

Calls 2

moveFunction · 0.85
clearMethod · 0.45

Tested by 1

mainFunction · 0.64