#pragma once #include "json.hpp" #ifdef WIN32 #include #endif // WIN32 #include #include //std::cout #define MACR2STR(R) #R #define STR2MACRO(R) MACR2STR(R) using json = nlohmann::json; using namespace std; struct Func { Func(std::function scan, std::function confirm, std::function canle, std::function stop, std::function getfw, std::function getser) : IscanFunction(scan), IconfirmFunction(confirm), IcancelFunction(canle), IstopFunction(stop),Igetfw(getfw),Igetser(getser) {} std::function IscanFunction; std::function IconfirmFunction; std::function IcancelFunction; std::function IstopFunction; std::function Igetfw; std::function Igetser; }; namespace Global { static inline std::string getSettingPath() { #ifdef WIN32 TCHAR dir[MAX_PATH] = { 0 }; SHGetSpecialFolderPath(NULL, dir, CSIDL_LOCAL_APPDATA, TRUE); int iLen = WideCharToMultiByte(CP_ACP, 0, (LPCWCH)dir, -1, NULL, 0, NULL, NULL); char* chRtn = new char[iLen * sizeof(char)]; WideCharToMultiByte(CP_ACP, 0, (LPCWCH)dir, -1, chRtn, iLen, NULL, NULL); std::string path(chRtn); delete[] chRtn; return path + "/huagoscan/"; #else std::cout<