MCPcopy Create free account
hub / github.com/KDAB/GammaRay / readFile

Function readFile

client/processtracker_linux.cpp:24–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22
23namespace {
24static QString readFile(const QString &filePath, const QByteArray &codec = QByteArrayLiteral("UTF-8"))
25{
26 QFile file(filePath);
27
28 if (!file.exists()) {
29 qWarning("%s: File does not exists", Q_FUNC_INFO);
30 return QString();
31 }
32
33 if (!file.open(QIODevice::ReadOnly)) {
34 qWarning("%s: File can not be opened", Q_FUNC_INFO);
35 return QString();
36 }
37
38 return QStringDecoder(codec).decode(file.readAll());
39}
40}
41
42using namespace GammaRay;

Callers 1

checkProcessMethod · 0.85

Calls 2

QStringClass · 0.50
existsMethod · 0.45

Tested by

no test coverage detected