CQtDeployer/Deploy/pathutils.h

91 lines
2.1 KiB
C
Raw Normal View History

//#
2019-12-08 13:57:20 +03:00
//# Copyright (C) 2018-2020 QuasarApp.
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
2019-12-20 17:25:20 +03:00
#ifndef PATHUTILS_H
#define PATHUTILS_H
2019-12-20 17:25:20 +03:00
#include <QString>
#include "deploy_global.h"
/**
* @brief The PathUtils class
*
*/
2019-09-29 20:12:16 +03:00
class DEPLOYSHARED_EXPORT PathUtils
{
public:
PathUtils();
2019-10-16 18:07:36 +03:00
/**
* @brief toFullPath remove all dublicate separators and insert separators into begin and end
* @param path
* @return return full path
*/
static QString toFullPath(QString path);
2019-10-16 18:07:36 +03:00
/**
* @brief getReleativePath
* @param path
* @return return releative path from "path" to root dir
*/
static QString getReleativePath(QString path);
2019-10-16 18:07:36 +03:00
/**
* @brief stripPath remove all dublicate separators and remove separators from begin and end
* @param path
* @return return strip patth
*/
static QString stripPath(QString path);
/**
* @brief getRelativeLink return releative path
* @param from
* @param to
* @return releative path
*/
static QString getRelativeLink(QString from, QString to);
2019-10-16 18:07:36 +03:00
/**
* @brief isPath
* @param path
* @return return true if imput value is path
*/
static bool isPath(const QString &path);
2019-10-16 18:07:36 +03:00
2020-01-10 16:02:07 +03:00
/**
* @brief isPath
* @param path
* @return return true if imput value is Releative path
*/
static bool isReleativePath(const QString &path);
2019-10-16 18:07:36 +03:00
/**
* @brief getDrive
* @param path
* @return char of drive in windows systems
*/
static QChar getDrive(QString path);
/**
* @brief isAbsalutPath
* @param path
* @return return true if path is absolute
*/
static bool isAbsalutPath(const QString &path);
2019-12-20 17:25:20 +03:00
/**
* @brief fixPath - this method make upper case for all symbols of path on windows os. on linux doing nothing
* @param path - a input path
* @return return a fixed path
*/
static QString fixPath(const QString & path);
};
#endif // PATHUTILS_H