ASFileManager.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // ASFileManager.h
  3. // AIPlayRingtones
  4. //
  5. // Created by mini on 2025/5/28.
  6. //
  7. #import <Foundation/Foundation.h>
  8. NS_ASSUME_NONNULL_BEGIN
  9. @interface ASFileManager : NSObject
  10. + (NSURL *)documentsDirectory;
  11. + (NSURL *)cacheDirectory;
  12. + (void)copyFileWithOverwriteFrom:(NSURL *)sourceURL to:(NSURL *)targetURL;
  13. + (void)removeItemFrom:(NSURL *)sourceURL;
  14. + (void)checkFolderAndCreateFrom:(NSURL *)destinationURL;
  15. + (BOOL)fileExistsAtURL:(NSURL *)url;
  16. + (void)createDirectoryAtURL:(NSURL *)url error:(NSError **)error;
  17. + (NSString *)getCacheSubPathAtURL:(NSURL *)url;
  18. @end
  19. @interface NSString (CachePath)
  20. @property (nonatomic, readonly) BOOL isCachesPath;
  21. @property (nonatomic, readonly) NSString *fillCachePath;
  22. @property (nonatomic, readonly) NSURL *fillCacheURL;
  23. @property (nonatomic, readonly) NSString *cachesLastURLString;
  24. @end
  25. @interface NSString (DocumentPath)
  26. @property (nonatomic, readonly) BOOL isDocumentPath;
  27. @property (nonatomic, readonly) NSString *fillDocumentPath;
  28. @property (nonatomic, readonly) NSURL *fillDocumentURL;
  29. @property (nonatomic, readonly) NSString *documentLastURLString;
  30. @end
  31. NS_ASSUME_NONNULL_END