/*! * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * \copyright \n * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n * IN PART OR IN WHOLE, \n * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n * * \file filehandler.h * \date 2019/09/30 * \author Behrouz NematiPour * */ #pragma once // Qt #include class QDate; 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 int copyFolder(const QString &vSource, const QString &vDestination); static int removeFiles(const QStringList &vFolders, const QStringList &vNameFilter, const QDate &vDateOlderThan); }; }