File indexing completed on 2025-02-09 06:01:30
0001 // SPDX-License-Identifier: GPL-2.0-or-later 0002 // SPDX-FileCopyrightText: 2022 Louis Schul <schul9louis@gmail.com> 0003 #pragma once 0004 0005 #include <QJsonObject> 0006 #include <QObject> 0007 #include <QUrl> 0008 0009 class DocumentHandler : public QObject 0010 { 0011 Q_OBJECT 0012 0013 public: 0014 explicit DocumentHandler(QObject *parent = nullptr); 0015 0016 Q_INVOKABLE static QString readFile(const QString &path); 0017 Q_INVOKABLE static void writeFile(const QString ¬e, const QString &path); 0018 Q_INVOKABLE static QString getCssStyle(const QString &path); 0019 0020 static bool checkForHeader(const QString &path, const QString &header); 0021 Q_INVOKABLE static QJsonObject getJson(const QString &jsonPath); 0022 Q_INVOKABLE static bool saveJson(const QJsonObject &json, const QString &path); 0023 };