forked from Public/monero-gui
'--verify-update', shasum support, OpenPGP signatures verification
This commit is contained in:
@@ -37,6 +37,24 @@ bool fileExists(QString path) {
|
||||
return check_file.exists() && check_file.isFile();
|
||||
}
|
||||
|
||||
QByteArray fileGetContents(QString path)
|
||||
{
|
||||
QFile file(path);
|
||||
if (!file.open(QFile::ReadOnly))
|
||||
{
|
||||
throw std::runtime_error(QString("failed to open %1").arg(path).toStdString());
|
||||
}
|
||||
|
||||
QByteArray data;
|
||||
data.resize(file.size());
|
||||
if (file.read(data.data(), data.size()) != data.size())
|
||||
{
|
||||
throw std::runtime_error(QString("failed to read %1").arg(path).toStdString());
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
QByteArray fileOpen(QString path) {
|
||||
QFile file(path);
|
||||
if(!file.open(QFile::ReadOnly | QFile::Text))
|
||||
|
||||
Reference in New Issue
Block a user