diff options
| author | xiphon <xiphon@protonmail.com> | 2020-04-06 16:57:32 +0000 |
|---|---|---|
| committer | xiphon <xiphon@protonmail.com> | 2020-04-12 21:34:22 +0000 |
| commit | 5f27a45910fcba954e652f3214bc489f03262346 (patch) | |
| tree | 151d35b69a466881628096f7130eefdd02758596 /src/qt/utils.cpp | |
| parent | 042400b83fdea6c18ea8a7970cb0a8af2070c03a (diff) | |
| download | monzero-gui-5f27a45910fcba954e652f3214bc489f03262346.tar.gz monzero-gui-5f27a45910fcba954e652f3214bc489f03262346.tar.xz monzero-gui-5f27a45910fcba954e652f3214bc489f03262346.zip | |
'--verify-update', shasum support, OpenPGP signatures verification
Diffstat (limited to 'src/qt/utils.cpp')
| -rw-r--r-- | src/qt/utils.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/qt/utils.cpp b/src/qt/utils.cpp index bcf69917..258400c3 100644 --- a/src/qt/utils.cpp +++ b/src/qt/utils.cpp @@ -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)) |
