| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #ifndef __UITILITY__
- #define __UITILITY__
- #include <string>
- #include <vector>
- using namespace std;
- #ifndef _UNICODE
- typedef string TString;
- #else
- typedef wstring TString;
- #endif
- #pragma once
- namespace utilitySdk
- {
- __declspec(dllexport) BOOL IsValidDate(IN LPCTSTR lpDate);
- __declspec(dllexport) BOOL IsValidLunanrDate(IN LPCTSTR lpDate);
- __declspec(dllexport) BOOL IsValidLunanrDate(int lunar_year, int lunar_month, int lunar_day);
- __declspec(dllexport) BOOL IsValidSolarStrDate(LPCTSTR lpStrDate, BOOL bThisyear);
- __declspec(dllexport) BOOL IsValidSolarDate(CONST int &nSolarYear, CONST int &nSolarMonth, CONST int &nSolarDay);
- __declspec(dllexport) INT DayOfSolarYear(IN const int &nSolarYear,IN const int &nSolarMonth, IN const int &nSolarDay);
- __declspec(dllexport) CString GetLunarDate(IN const int &nSolarYear, IN const int &nSolarMonth, IN const int &nSolarDay); // 包含CString就不能使用静态库包含编译方式;
- __declspec(dllexport) INT GetLunarDate(OUT LPTSTR lpLunarDate,IN const int &nSolarYear, IN const int &nSolarMonth, IN const int &nSolarDay);
- __declspec(dllexport) CString LuanrToSolarDate(IN const int &nLunarYear, IN const int &nLunarMonth, IN const int &nLunarDay, BOOL bIsLeapMonth );
- __declspec(dllexport) BOOL LuanrToSolarDate(OUT LPTSTR lpSolarDate,IN const int &nLunarYear, IN const int &nLunarMonth, IN const int &nLunarDay, BOOL bIsLeapMonth );
- __declspec(dllexport) INT IsLeapMonth(IN const int &nLunarYear);
- __declspec(dllexport) BOOL GetFileVersion( IN HMODULE hModule, IN DWORD (&dwArray)[4]);
- __declspec(dllexport) BOOL GetFileVersionEx( IN LPCTSTR lpFileName, IN DWORD (&dwArray)[4] );
- __declspec(dllexport) BOOL GetProductVersion( IN HMODULE hModule, IN DWORD (&dwArray)[4]);
- __declspec(dllexport) BOOL GetProductVersionEx( IN LPCTSTR lpFileName, IN DWORD (&dwArray)[4] );
- __declspec(dllexport) BOOL GetDiskSpaceInfo(IN LPCTSTR lpRootPathName,IN OUT double &dTotalNum, IN OUT double &dFreeNum);
- __declspec(dllexport) DWORD FindProcess(IN LPCTSTR lpProName);
- __declspec(dllexport) BOOL FindProcess(IN LPCTSTR lpFilepath, OUT DWORD &dwProcessID);
- __declspec(dllexport) int FindAndCloseProcess(IN LPCTSTR lpProName);
- __declspec(dllexport) void GetErrorSysDescription(const DWORD &dwError, IN LPTSTR lpDescription, IN int const& nMaxLen);
- __declspec(dllexport) DWORD64 GetFolderSize(IN LPCTSTR lpPath, OUT DWORD *dwFiles = NULL, OUT DWORD *dwFolders = NULL);
- __declspec(dllexport) BOOL CreateDirectoryEx(IN LPCTSTR lpNewDirectory);
- __declspec(dllexport) BOOL IsValidpath(IN LPCTSTR lpPath);
- __declspec(dllexport) void DeleteDirectory(IN LPCTSTR lpDirectory);
- // 获取文件夹的修改时间;
- __declspec(dllexport) BOOL GetDirLastWriteTime(IN LPCTSTR lpDirName, OUT LPTSTR lpszString, IN CONST DWORD& dwSize);
- // 设置文件夹的修改时间;
- __declspec(dllexport) BOOL SetDirLastWriteTime();
- // 获取指定文件句柄的修改时间;
- __declspec(dllexport) BOOL GetLastWriteTime(IN HANDLE hFile, OUT LPTSTR lpszString, IN CONST DWORD& dwSize);
- // 设置指定文件夹的修改时间;
- __declspec(dllexport) BOOL SetFileLastWirteTime(IN LPCTSTR lpDirName, IN SYSTEMTIME &st);
- __declspec(dllexport) int match(IN CONST TString &sExt, IN CONST TString &sFile);
- __declspec(dllexport) TString getfilename(IN CONST TString &file);
- __declspec(dllexport) CString getfilename(IN CONST CString &file);
- __declspec(dllexport) TString lowercase(IN const TString &Str);
- __declspec(dllexport) TString uppercase(IN const TString &Str);
- __declspec(dllexport) BOOL CompareNoCase(IN TString& str1, IN TString& str2);
- __declspec(dllexport) BOOL IsStringExist(IN CString& str, IN CStringArray &tagAry);
- __declspec(dllexport) BOOL IsStringExist(IN TString& str, IN vector<TString> &tagVt);
- __declspec(dllexport) BOOL IsStringExistNoCase(IN CString& str, IN CStringArray &tagAry);
- __declspec(dllexport) BOOL IsStringExistNoCase(IN CONST TString& str, IN CStringArray &tagAry);
- __declspec(dllexport) BOOL IsStringExistNoCase(IN CONST TString& str, IN vector<TString> &tagVt);
- __declspec(dllexport) unsigned char *sha1(const unsigned char *msg,size_t size, unsigned char result[21]);
- __declspec(dllexport) unsigned char *sha1Hex(const unsigned char *msg, size_t size, unsigned char szHexResult[41]);
- // 是否合法路径;
- __declspec(dllexport) BOOL IsLegitimateDirectory(const CString &strDirectory);
- };
- #endif
|