Index: sources/storage/FileHandler.h =================================================================== diff -u -r340cae5888596d927601687476618d0ede343a35 -r5687815256ae070a9a207107088e3f72dd464da0 --- sources/storage/FileHandler.h (.../FileHandler.h) (revision 340cae5888596d927601687476618d0ede343a35) +++ sources/storage/FileHandler.h (.../FileHandler.h) (revision 5687815256ae070a9a207107088e3f72dd464da0) @@ -1,30 +1,26 @@ /*! * - * Copyright (c) 2020-2023 Diality Inc. - All Rights Reserved. + * Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file FileHandler.h * \author (last) Behrouz NematiPour - * \date (last) 18-Jul-2023 + * \date (last) 04-Apr-2024 * \author (original) Behrouz NematiPour * \date (original) 26-Aug-2020 * */ #pragma once // Qt -#include -#include -#include -#include -#include - #include #include -#include +// forward declarations +class tst_fileHandler; + class QDate; namespace Storage { @@ -38,6 +34,8 @@ */ class FileHandler { + // friends + friend class ::tst_fileHandler; public: enum FileCopyError_Enums { @@ -62,8 +60,8 @@ static bool write (const QString &vFileName, const QString &vContent, bool vAppend = true ); static bool read (const QString &vFileName, QString &vContent, bool vAppend = false); - static bool read (const QString &vFileName, QJsonObject &vContent, QJsonParseError *error = nullptr); + static int backupFile (const QString &vSource); static int copyFolder (const QString &vSource , const QString &vDestination); static int moveFolder (const QString &vSource , const QString &vDestination); static int removeFolder(const QString &vFolder); @@ -81,6 +79,9 @@ static bool isPathSymLink(const QString &vFilePath); + static QString sha256sum( QString vFileName, bool *vOk = nullptr ); + + /*! * \brief FileHandler::copyFile * \details Copies a file chunk by chunk