MCPcopy Create free account
hub / github.com/awawa-dev/HyperHDR / readFile

Function readFile

sources/utils/FileUtils.cpp:18–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16 }
17
18 bool readFile(const QString& path, QString& data, Logger* log, bool ignError)
19 {
20 QFile file(path);
21 if (!fileExists(path, log, ignError))
22 {
23 return false;
24 }
25
26 if (!file.open(QFile::ReadOnly | QFile::Text))
27 {
28 if (!ignError)
29 resolveFileError(file, log);
30 return false;
31 }
32
33 QTextStream in(&file);
34
35 data = in.readAll();
36
37 file.close();
38
39 return true;
40 }
41
42 bool fileExists(const QString& path, Logger* log, bool ignError)
43 {

Callers 1

getLedDeviceSchemasMethod · 0.50

Calls 4

fileExistsFunction · 0.85
resolveFileErrorFunction · 0.85
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected