cachesFileManager.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. NS_ASSUME_NONNULL_BEGIN
  19. @interface cachesFileManager : NSObject
  20. //获取文件路径(没有的话创建)
  21. + (NSString *)getCreateFilePath:(NSString *)path;
  22. + (BOOL)checkFileIsSaveState:(NSString *)fileName withType:(uploadFileType)type;
  23. //获取资源名字并且保存资源
  24. + (NSString *)getFileNameWithContent:(id)content fileName:(NSString*)fileName type:(uploadFileType)type;
  25. //获取资源路径
  26. + (NSString *)getFilePathWithName:(NSString *)name type:(uploadFileType)type;
  27. + (BOOL)copyVideoItemAtPath:(NSString *)Path fileName:(NSString *)fileName error:(NSError *__autoreleasing *)error;
  28. //删除文件
  29. + (BOOL)removeItemAtPath:(NSString *)fileName type:(uploadFileType)type error:(NSError *__autoreleasing *)error;
  30. @end
  31. NS_ASSUME_NONNULL_END