BaseFun.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #include <vector>
  2. #include <string>
  3. #include "fileutil.h"
  4. #include "SpBase.h"
  5. #ifdef _WIN32
  6. #include <windows.h>
  7. #endif
  8. using namespace std;
  9. bool Unzip2Folder(BSTR lpZipFile, BSTR lpFolder); //解压文件到文件夹
  10. void split(const string& src, const string& separator, vector<string>& dest);
  11. bool checkDirExist(const string &strPath);
  12. bool checkFileExist(string fileName);
  13. void getDirs(string path, vector<string> &ownname);
  14. bool createDir(const string &filePath);
  15. bool removeDir(const string &filePaht);
  16. void Wchar_tToString(std::string& szDst, wchar_t *wchar);
  17. void StringToWstring(std::wstring& szDst, std::string str);
  18. void stopForDebug();
  19. bool getUniqueDir(string path, string &dirName);//获取路径中唯一的一个文件夹名,失败返回false
  20. UINT
  21. GetPrivateProfileIntEx(
  22. LPCSTR lpAppName,
  23. LPCSTR lpKeyName,
  24. INT nDefault,
  25. LPCSTR lpFileName
  26. );
  27. BOOL
  28. WritePrivateProfileStringEx(
  29. LPCSTR lpAppName,
  30. LPCSTR lpKeyName,
  31. LPCSTR lpString,
  32. LPCSTR lpFileName
  33. );
  34. DWORD
  35. GetPrivateProfileStringEx(
  36. LPCSTR lpAppName,
  37. LPCSTR lpKeyName,
  38. LPCSTR lpDefault,
  39. LPSTR lpReturnedString,
  40. DWORD nSize,
  41. LPCSTR lpFileName
  42. );
  43. DWORD
  44. GetPrivateProfileSectionEx(
  45. LPCSTR lpAppName,
  46. LPSTR lpReturnedString,
  47. DWORD nSize,
  48. LPCSTR lpFileName
  49. );
  50. DWORD
  51. GetPrivateProfileSectionNamesEx(
  52. LPSTR lpszReturnBuffer,
  53. DWORD nSize,
  54. LPCSTR lpFileName
  55. );