/*! * * Copyright (c) 2019-2019 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 #include // Project #include "main.h" // Define #define _FileHandler FileHandler::I() namespace Storage { class FileHandler : public QObject { Q_OBJECT QProcess _processCopyFolder; // Singleton SINGLETON_DECL(FileHandler) public: bool init(); void quit(); private: void initConnections(); bool write(const QString &vFileName, const QString &vContent, bool vAppend); bool read (const QString &vFileName, QString &vContent); signals: void didWrite(const QString &vFileName); void didRead (const QString &vFileName, const QString &vContent); public slots: bool onWrite (const QString &vFileName, const QString &vContent, bool vAppend = true); private slots: bool onRead (const QString &vFileName); bool onExportLog(); }; }