COMPASSi/trunk/code/inc/Util/include/PathUtil.h

57 lines
1.1 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef PATHUTIL_H
#define PATHUTIL_H
#include <QString>
#include <QSettings>
#include "UtilityGlobal.h"
#include <filesystem>
#include "nlohmann/json.hpp"
using json = nlohmann::json;
#ifdef __cplusplus
extern"C"{
#endif
// 路径帮助类用于获取bin、data、config、trans等文件夹路径
class UTILITY_API PathUtil
{
public:
/** end with '/' */
static const QString bin_dir();
/** end with '/' */
static const QString& data_dir();
/** end with '/' */
static const QString& config_dir();
/** end with '/' */
static const QString& trans_dir();
static const QString get_default_path();
static std::string jsonContainsKeyToString(const json &j ,std::string strkey);
static QString jsonContainsKeyToQString(const json &j ,std::string strkey);
static int jsonContainsKeyToInt(const json &j ,std::string strkey);
static double jsonContainsKeyToDouble(const json &j ,std::string strkey);
static QString getEndMark();
static QString getLogEndLine();
static void deleteFile(const QString &filePath);
private:
PathUtil();
Q_DISABLE_COPY(PathUtil)
};
#ifdef __cplusplus
}
#endif
#endif