cachesFileManager.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. //从文件APP中 拷贝到app里面
  15. #define kSHPath_FileAPP [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/FileApp",CachesPatch]]
  16. //下载缩略图 图片 DownLoadThumbnail
  17. #define kSHPath_DownLoadThumbnail [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/DownLoadThumbnail",CachesPatch]]
  18. //下载文件 图片 DownLoadFile
  19. #define kSHPath_DownLoadFlie [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/DownLoadFlie",CachesPatch]]
  20. //云机最后一帧 路径
  21. #define kSHPath_cloudPhone_last_image [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/lastImage_%@/111.png",CachesPatch,ksharedAppDelegate.DeviceThirdIdMod.data.sn]]
  22. //日志路径
  23. #define kSHPath_logs [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/logs/",CachesPatch]]
  24. #define kSHPath_Crashlogs [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/Crashlogs/",CachesPatch]]
  25. NS_ASSUME_NONNULL_BEGIN
  26. @interface cachesFileManager : NSObject
  27. //获取文件路径(没有的话创建)
  28. + (NSString *)getCreateFilePath:(NSString *)path;
  29. + (BOOL)checkFileIsSaveState:(NSString *)fileName withType:(uploadFileType)type;
  30. //获取资源名字并且保存资源
  31. + (NSString *)getFileNameWithContent:(id)content fileName:(NSString*)fileName type:(uploadFileType)type;
  32. //获取资源路径
  33. + (NSString *)getFilePathWithName:(NSString *)name type:(uploadFileType)type;
  34. + (BOOL)copyVideoItemAtPath:(NSString *)Path fileName:(NSString *)fileName error:(NSError *__autoreleasing *)error;
  35. //删除文件
  36. + (BOOL)removeItemAtPath:(NSString *)fileName type:(uploadFileType)type error:(NSError *__autoreleasing *)error;
  37. //写日志
  38. + (void)writeLogsWithMsg:(NSString *)msg;
  39. //写日志
  40. + (void)writeCrashLogsWithMsg:(NSString *)msg;
  41. @end
  42. NS_ASSUME_NONNULL_END