/*! * * Copyright (c) 2019-2020 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) 02-Apr-2020 * \author (original) Behrouz NematiPour * \date (original) 24-Sep-2019 * */ #pragma once // Qt #include #include #include #include namespace Storage { /*! * \brief The FileHandler class * This class is suppose to be the static class * which contains methods to manipulate files and folders * Since it is static it doesn't have thread so needs to be used with care * and the class(es) which is using it needs to be taking care of the threading */ class FileHandler { static void errOut(const QString &vMessage); public: static bool write(const QString &vFileName, const QString &vContent, bool vAppend = true); static bool read (const QString &vFileName, QString &vContent); static bool readCSV(const QString &vFileName, QString &vContent); static bool readJSON(const QString &vFileName, QJsonObject &vContent); static int copyFolder(const QString &vSource, const QString &vDestination); }; }