cachesFileManager.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // cachesFileManager.h
  3. // 隐私保护
  4. //
  5. // Created by xd h on 2023/11/21.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "uploadFileDataModel.h"
  9. #define CachesPatch NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]
  10. //图片路径
  11. #define kSHPath_image [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/Image",CachesPatch]]
  12. //视频路径
  13. #define kSHPath_video [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/Video",CachesPatch]]
  14. //下载缩略图 图片 DownLoadThumbnail
  15. #define kSHPath_DownLoadThumbnail [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/DownLoadThumbnail",CachesPatch]]
  16. //下载文件 图片 DownLoadFile
  17. #define kSHPath_DownLoadFlie [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/DownLoadFlie",CachesPatch]]
  18. //云机最后一帧 路径
  19. #define kSHPath_cloudPhone_last_image [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/lastImage_%@/111.png",CachesPatch,ksharedAppDelegate.DeviceThirdIdMod.data.sn]]
  20. //日志路径
  21. #define kSHPath_logs [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/logs/",CachesPatch]]
  22. #define kSHPath_Crashlogs [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/Crashlogs/",CachesPatch]]
  23. NS_ASSUME_NONNULL_BEGIN
  24. @interface cachesFileManager : NSObject
  25. //获取文件路径(没有的话创建)
  26. + (NSString *)getCreateFilePath:(NSString *)path;
  27. + (BOOL)checkFileIsSaveState:(NSString *)fileName withType:(uploadFileType)type;
  28. //获取资源名字并且保存资源
  29. + (NSString *)getFileNameWithContent:(id)content fileName:(NSString*)fileName type:(uploadFileType)type;
  30. //获取资源路径
  31. + (NSString *)getFilePathWithName:(NSString *)name type:(uploadFileType)type;
  32. + (BOOL)copyVideoItemAtPath:(NSString *)Path fileName:(NSString *)fileName error:(NSError *__autoreleasing *)error;
  33. //删除文件
  34. + (BOOL)removeItemAtPath:(NSString *)fileName type:(uploadFileType)type error:(NSError *__autoreleasing *)error;
  35. //写日志
  36. + (void)writeLogsWithMsg:(NSString *)msg;
  37. //写日志
  38. + (void)writeCrashLogsWithMsg:(NSString *)msg;
  39. @end
  40. NS_ASSUME_NONNULL_END