MCPcopy Create free account
hub / github.com/Adaptix-Framework/AdaptixC2 / readFile

Method readFile

AdaptixClient/Libs/kddockwidgets/core/Platform.cpp:258–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258QByteArray Platform::readFile(const QString &fileName, bool &ok) const
259{
260 ok = true;
261
262 std::ifstream file(fileName.toStdString(), std::ios::binary);
263 if (!file.is_open()) {
264 KDDW_ERROR("Failed to open {}", fileName);
265 ok = false;
266 return {};
267 }
268
269 QByteArray data;
270
271 file.seekg(0, std::ios::end);
272 std::streampos fileSize = file.tellg();
273 file.seekg(0, std::ios::beg);
274
275 data.resize(int(fileSize));
276
277 file.read(data.data(), fileSize);
278 file.close();
279
280 return data;
281}
282
283bool Platform::supportsAeroSnap() const
284{

Callers 3

restoreFromFileMethod · 0.45

Calls 5

toStdStringMethod · 0.80
readMethod · 0.80
resizeMethod · 0.45
dataMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected