baseEx.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #include "SpBase.h"
  3. #include<vector>
  4. #include<string>
  5. extern void* logProducer;
  6. extern bool g_useMagic;
  7. #if defined(RVC_OS_WIN)
  8. extern bool g_useMagic;
  9. #endif //RVC_OS_WIN
  10. void DbgEx(const char* str, ...);
  11. std::vector<std::string> find_files(const std::string srcPath, const std::string fileName, bool isDir = false);
  12. std::string generateTimeStr(bool isSimple = false);
  13. DWORD SaveCefclientLog(std::string magicStr);
  14. bool SYSTEM_ON(std::string cmdLine, bool isWait = true);
  15. bool InitFileLogger(std::string dbgPath);
  16. void DbgToFileLogger(std::string msg);
  17. bool deleteDir_byFileSystem(const std::string srcPath);
  18. void InitTranslateFile(std::string srcFile);
  19. std::pair<unsigned long, std::string> splitStrToUserCodeAndErrMsg(std::string srcMsg);
  20. std::string UtfToGbk(const char* utf8);
  21. std::string ConvertGBKToUtf8(std::string& strGBK);
  22. void hexdump(const char* buf, const int num);
  23. std::string hexdumpToString(const char* buf, const int num);
  24. bool modifyBySpecialStr(std::wstring& src);
  25. void receivehexdump(const char* buf, const int num);
  26. void doWithDebugModeData(const char* strMethod, const char* buf);
  27. class json_deal {
  28. public:
  29. static std::pair<bool, CSimpleStringA> getStringFromCjsonObj(void* object, const char* name);
  30. static std::pair<bool, int> getIntergerFromCjsonObj(void* object, const char* name);
  31. static std::pair<bool, double> getDoubleFromCjsonObj(void* object, const char* name);
  32. };
  33. #if (defined _WIN32 || defined _WIN64)
  34. long WINAPI printSEG(struct _EXCEPTION_POINTERS* ExceptionInfo);
  35. #else
  36. long printSEG();
  37. void set_traceback_path(std::string path);
  38. void seg_signal_handler(int signum);
  39. void normal_signal_handle(int signum);
  40. #endif