Commit c9174ca4 authored by captainwong's avatar captainwong

update

parent c024947b
......@@ -7,12 +7,12 @@
JLIBQT_NAMESPACE_BEGIN
//! 获取错误码文字描述
//! 获取错误码文字描述
inline QString ecString(const std::error_code& ec) {
return QString::fromLocal8Bit(ec.message().data());
}
//! 获取错误码文字描述(带有错误目录)
//! 获取错误码文字描述(带有错误目录)
inline QString ecStringWithCategory(const std::error_code& ec) {
return QString::fromLocal8Bit(ec.category().name()) + ": " + QString::fromLocal8Bit(ec.message().data());
}
......
......@@ -31,9 +31,9 @@
#define MYQWARN2_NOQUOTE qWarning().noquote() << QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss") << JLIBQT_QDEBUG_FILE_LINE_STREAM
#define MYQCRITICAL2_NOQUOTE qCritical().noquote() << QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss") << JLIBQT_QDEBUG_FILE_LINE_STREAM
//! 弹窗报告行号开关
//! 弹窗报告行号开关
// #define JLIBQT_SHOW_LINE 0
//! 当行号大于下方定义的值时,弹窗报告行号,否则忽略。可在多个cpp文件分别定义不同的值。
//! 当行号大于下方定义的值时,弹窗报告行号,否则忽略。可在多个cpp文件分别定义不同的值。
// #define JLIBQT_SHOW_MSGBOX_AFTER_LINE 1
#if JLIBQT_SHOW_LINE
......
......@@ -40,9 +40,9 @@ struct PathHelper
protected:
// disable constructor
explicit PathHelper() {}
//! 应用程序安装目录
//! 应用程序安装目录
QString programPath_ = {};
//! 应用程序路径
//! 应用程序路径
QString exePath_ = {};
};
......@@ -59,8 +59,8 @@ struct AutoSwithToBin {
};
/*
* @brief 路径辅助类,数据保存在安装目录,程序和dll在bin文件夹
* @note 大致结构树为:
* @brief 路径辅助类,数据保存在安装目录,程序和dll在bin文件夹
* @note 大致结构树为:
* @note |-- program-install-dir
* @note | |-- bin
* @note | | |-- program.exe
......@@ -82,8 +82,8 @@ struct PathHelperLocal : PathHelper
/*
* @brief 路径辅助类,数据保存在安装目录,程序和dll也在安装目录
* @note 大致结构树为:
* @brief 路径辅助类,数据保存在安装目录,程序和dll也在安装目录
* @note 大致结构树为:
* @note |-- program-install-dir
* @note | |-- dumps
* @note | |-- log
......@@ -105,11 +105,11 @@ struct PathHelperLocalWithoutBin : PathHelper
};
/*
* @brief 路径辅助类,数据保存在其他可写目录,如 C:/Users/[USER]/AppData/Roaming
* @note program-name 无需设置,Qt会自动设置
* @note 如果在调用此类之前先调用了 QCoreApplication::setOrganizationName("your-organization-name");
* @note 那么program-name在your-organization-name下
* @note 大致结构树为:
* @brief 路径辅助类,数据保存在其他可写目录,如 C:/Users/[USER]/AppData/Roaming
* @note program-name 无需设置,Qt会自动设置
* @note 如果在调用此类之前先调用了 QCoreApplication::setOrganizationName("your-organization-name");
* @note 那么program-name在your-organization-name下
* @note 大致结构树为:
* @note |-- program-install-dir
* @note | |-- bin
* @note | | |-- program.exe
......@@ -142,11 +142,11 @@ protected:
};
/*
* @brief 路径辅助类,数据保存在其他可写目录,如 C:/Users/[USER]/AppData/Roaming
* @note program-name 无需设置,Qt会自动设置
* @note 如果在调用此类之前先调用了 QCoreApplication::setOrganizationName("your-organization-name");
* @note 那么program-name在your-organization-name下
* @note 大致结构树为:
* @brief 路径辅助类,数据保存在其他可写目录,如 C:/Users/[USER]/AppData/Roaming
* @note program-name 无需设置,Qt会自动设置
* @note 如果在调用此类之前先调用了 QCoreApplication::setOrganizationName("your-organization-name");
* @note 那么program-name在your-organization-name下
* @note 大致结构树为:
* @note |-- program-install-dir
* @note | |-- program.exe
* @note | |-- *.dlls
......
......@@ -13,6 +13,8 @@ namespace jlib
//! 应用程序版本分支
enum class Branch : int {
// 开发版,开发人员自测
Dev,
//! 测试版,一般仅用于测试人员测试
Test,
//! 体验版,可以投放给少量用户进行灰度测试
......@@ -25,12 +27,14 @@ enum class Branch : int {
InvalidBranch = 0x0FFFFFFF,
};
static constexpr auto BranchNameDev = "dev";
static constexpr auto BranchNameTest = "test";
static constexpr auto BranchNameExperimental = "experimental";
static constexpr auto BranchNameStable = "stable";
inline const char* branchName(Branch branch) {
switch (branch) {
case jlib::Branch::Dev: return BranchNameDev;
case jlib::Branch::Test: return BranchNameTest;
case jlib::Branch::Experimental: return BranchNameExperimental;
case jlib::Branch::Stable: return BranchNameStable;
......@@ -39,7 +43,8 @@ inline const char* branchName(Branch branch) {
}
inline Branch branchFromString(const std::string& name) {
if (name == BranchNameTest) { return Branch::Test; }
if (name == BranchNameDev) { return Branch::Dev; }
else if (name == BranchNameTest) { return Branch::Test; }
else if (name == BranchNameExperimental) { return Branch::Experimental; }
else if (name == BranchNameStable) { return Branch::Stable; }
else { return Branch::InvalidBranch; }
......
......@@ -42,9 +42,9 @@ struct PathHelper
protected:
// disable constructor
explicit PathHelper() {}
//! 应用程序安装目录
//! 应用程序安装目录
std::string programPath_ = {};
//! 应用程序路径
//! 应用程序路径
std::string exePath_ = {};
};
......@@ -61,8 +61,8 @@ struct AutoSwithToBin {
};
/*
* @brief 路径辅助类,数据保存在安装目录,程序和dll在bin文件夹
* @note 大致结构树为:
* @brief 路径辅助类,数据保存在安装目录,程序和dll在bin文件夹
* @note 大致结构树为:
* @note |-- program-install-dir
* @note | |-- bin
* @note | | |-- program.exe
......@@ -83,8 +83,8 @@ struct PathHelperLocal : PathHelper
/*
* @brief 路径辅助类,数据保存在安装目录,程序和dll也在安装目录
* @note 大致结构树为:
* @brief 路径辅助类,数据保存在安装目录,程序和dll也在安装目录
* @note 大致结构树为:
* @note |-- program-install-dir
* @note | |-- dumps
* @note | |-- log
......@@ -105,8 +105,8 @@ struct PathHelperLocalWithoutBin : PathHelper
};
/*
* @brief 路径辅助类,数据保存在其他可写目录,如 C:/Users/[USER]/AppData/Roaming
* @note 大致结构树为:
* @brief 路径辅助类,数据保存在其他可写目录,如 C:/Users/[USER]/AppData/Roaming
* @note 大致结构树为:
* @note |-- program-install-dir
* @note | |-- bin
* @note | | |-- program.exe
......@@ -140,8 +140,8 @@ protected:
};
/*
* @brief 路径辅助类,数据保存在其他可写目录,如 C:/Users/[USER]/AppData/Roaming
* @note 大致结构树为:
* @brief 路径辅助类,数据保存在其他可写目录,如 C:/Users/[USER]/AppData/Roaming
* @note 大致结构树为:
* @note |-- program-install-dir
* @note | |-- program.exe
* @note | |-- *.dlls
......
#pragma once
#pragma once
#include "../base/config.h"
#include <ShlObj.h>
......
#pragma once
#pragma once
#include <Windows.h>
#include <tlhelp32.h>
......
#pragma once
#pragma once
#include <Windows.h>
#include <vector>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment