#pragma once #include #include #include #include #include "ResDataObject.h" using namespace std; bool AddEnvPath(const char *pPath); UINT64 GetDay(UINT64 TheTime); __time64_t GetCurrentRealTimeOfStk(); int CompareTimeByDay(UINT64 Prev, UINT64 Cur); bool string_2_guid(const char *pstr, GUID &stGuid); bool guid_2_string(GUID &stGuid, string &str); bool SplitString(const char *pString, string args, vector &nodes); bool SplitTo84422222222String(const char *pString, vector &nodes); bool CreateFileDirectory(string &FullFilePath); string FormatstdString(const char *pcFormat, ...); bool getBusIdFromFilePath(const char *pFilePath,string &BusId); bool SplitDevicePath(const char *pDevicePath, vector &nodes); bool MergeDevicePath(vector &nodes, string &Devpath); string GetProcessDirectory(); string GetFileTitle(string &fullpath); string GetFileName(string &fullpath); string & makeLowerStr(string & src); string GetFileDirectory(string &fullpath); bool FindSubVersionDirs(string rootDir, map>& dirlist); bool FindSortedSubFiles(string rootFile, vector &filelist); void RawToHex(const char *pRaw, DWORD RawLen, string &Hex); string ReplaceSubString(string org, string &keystr, string &replacestr); string ReplaceFileTitle(string FilePath, string NewTitle); bool FindSubFiles(string rootDir, vector &filelist, bool Recursive = true, string strWildcard = "*"); template bool StrToIntT(const char * str, Type *result) { Type value = 0; Type sign = 1; Type radix; if (str == NULL) { return false; } if (strlen(str) == 0) { return false; } if (*str == '-') { sign = -1; str++; } if (*str == '0' && (*(str + 1) == 'x' || *(str + 1) == 'X')) { radix = 16; str += 2; } //else if(*str == '0') //{ // radix = 8; // str++; //} else { bool HitF = false; size_t Len = strlen(str); for (size_t i = 0; i < Len; i++) { if (str[i] >= '0' && str[i] <= '9') { continue; } HitF = true; break; } if (HitF) { radix = 16; } else { radix = 10; } } while (*str) { if (radix == 16) { if (*str >= '0' && *str <= '9') { value = value * radix + *str - '0'; } else { if ((*str | 0x20) >= 'a' && (*str | 0x20) <= 'f') { value = value * radix + (*str | 0x20) - 'a' + 10; } else { return false; } } } else { value = value * radix + *str - '0'; } str++; } *result = sign*value; return true; }; class common_api { public: common_api(void); virtual ~common_api(void); HANDLE m_NotifyEvent; };