AppConfig.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef APPCONFIG_H
  2. #define APPCONFIG_H
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <string>
  6. #if defined(WIN32)
  7. #define PRINT_INT64_FORMAT "%I64d"
  8. #else
  9. #include <sys/time.h>
  10. #include <stdio.h>
  11. #include <unistd.h>
  12. void Sleep(long mSeconds);
  13. #define PRINT_INT64_FORMAT "%lld"
  14. #endif
  15. typedef unsigned char uchar;
  16. class AppConfig
  17. {
  18. public:
  19. AppConfig();
  20. static int VERSION;
  21. static char VERSION_NAME[32];
  22. static void mkdir(char *dirName); //创建文件夹
  23. static void mkpath(char *path); //创建多级文件夹
  24. static void removeDir(char *dirName);
  25. static void removeFile(const char *filePath);
  26. static void copyFile(const char *srcFile, const char *destFile);
  27. static void replaceChar(char *string, char oldChar, char newChar); //字符串替换字符
  28. static std::string removeFirstAndLastSpace(std::string &s); //移除开始和结束的空格
  29. static std::string getIpFromRtspUrl(std::string rtspUrl); //从rtsp地址中获取ip地址
  30. static void mSleep(int mSecond);
  31. static int64_t getTimeStamp_MilliSecond(); //获取时间戳(毫秒)
  32. };
  33. #endif // APPCONFIG_H