#include "tools.h"

#include <QDir>

void Tools::printTime()
{
    qDebug() << QTime::currentTime().toString("hh:mm:ss.zzz");
}


QString Tools::getTime()
{
    return QTime::currentTime().toString("hh:mm:ss.zzz");
}

QString Tools::createLocalPath(QString path)
{
    //qDebug() << "Full path: " << path;
    qint8 pos = path.indexOf(applicationFolderName);

    QString localPath = path.remove(0,--pos);

    //qDebug() << "Local path: " << localPath;
    return localPath;
}

QString Tools::createRootPath(QString path)
{
    return QDir::currentPath() + path;
}

QString Tools::createRootScenario(QString path){
    return QDir::currentPath() + scenarioRootPath + path;
}


QString Tools::createUpdateFilePath(QString path)
{
    //qDebug() << "Full path: " << path;
    qint8 pos = path.indexOf(streamingAssetsFolderName);

    QString localPath = path.remove(0,--pos);

    //qDebug() << "Local path: " << localPath;
    return localPath;
}

QString Tools::createFolderPath(QString path)
{
    quint8 pos = path.lastIndexOf("\\");

    QString folderPath = path.remove(pos,path.length() - pos);

    return folderPath;
}
