#include "fileutilstest.h"

#include <core/pqapppath.h>
#include <utils/pqfileutils.h>
#include <QDebug>

using namespace PQ;

void writeFile()
{
    QString ftest = AppPath::this_()->baseDir().absoluteFilePath("test.text");
    QByteArray td("test file info\\\\ //");
    writeAbsoluteFile(ftest,td);
    auto rd = readAbsoluteFile(ftest);
    qDebug() << "read data: " << rd;
    weiteCache();
    writeConfig();
}

void weiteCache()
{
    CacheFile::writeFile("a.cache","a.chche");
     qDebug() << "read cache data: " << CacheFile::readFile("a.cache");
}

void writeConfig()
{
    QJsonObject obj;
    obj.insert("name","aaa");
    ConfigFile::writeObject("name.conf.json",obj);
    qDebug() << ConfigFile::readObject("name.conf.json");
}
