blob: adbf2256b6466a325d91463ac9736611cdd31a7f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "utils.h"
#include <QDebug>
#include <QFile>
QByteArray fileContents(const QString &filePath)
{
QFile file(filePath);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
qWarning("Warning: Could not open '%s'.", qPrintable(filePath));
return QByteArray();
}
return file.readAll();
}
|