5 #import <Foundation/Foundation.h>
10 #if __has_extension(attribute_deprecated_with_message)
11 # define DEPRECATED_IN_NSFILEMANAGER __attribute__((deprecated("Deprecated in NSFileManager. Do not use.")))
13 # define DEPRECATED_IN_NSFILEMANAGER __attribute__((deprecated))
18 #if __has_extension(attribute_unavailable_with_message)
19 # define UNAVAILABLE_IN_GDFILEMANAGER __attribute__((unavailable("Unavailable in GDFileManager. Do not use.")))
21 # define UNAVAILABLE_IN_GDFILEMANAGER __attribute__((deprecated))
25 #if (defined(__MAC_10_12) && defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_12)\
26 || (defined(__IPHONE_10_0) && defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0)
27 # define GD_NSFileAttributeKey NSFileAttributeKey
28 # define GD_NSURLResourceKey NSURLResourceKey
30 # define GD_NSFileAttributeKey NSString *
31 # define GD_NSURLResourceKey NSString *
43 NS_ASSUME_NONNULL_BEGIN
289 + (nullable
GDCReadStream*) getReadStream:(NSString*)filePath error:(NSError** ) error;
312 + (nullable
GDCWriteStream*) getWriteStream:(NSString*)filePath appendmode:(BOOL) flag error:(NSError**) error;
325 + (nullable NSString*)getAbsoluteEncryptedPath:(NSString*)filePath;
349 + (nullable NSString*)pathForCFromManagerPath: (NSString*) filePath;
375 + (nullable NSString*)pathForManagerFromCPath: (NSString*) filePath;
378 #if __has_extension(attribute_deprecated_with_message)
379 # define DEPRECATE_EXP_LOGFILE_TO_DOC_FOLDER __attribute__((deprecated("Will be removed.")))
381 # define DEPRECATE_EXP_LOGFILE_TO_DOC_FOLDER __attribute__((deprecated))
402 + (BOOL)exportLogFileToDocumentsFolder:(NSError**)error DEPRECATE_EXP_LOGFILE_TO_DOC_FOLDER;
406 - (nullable NSURL *)URLForDirectory:(NSSearchPathDirectory)directory inDomain:(NSSearchPathDomainMask)domain appropriateForURL:(nullable NSURL *)url create:(BOOL)shouldCreate error:(NSError **)error;
408 - (NSArray<NSURL *> *)URLsForDirectory:(NSSearchPathDirectory)directory inDomains:(NSSearchPathDomainMask)domainMask;
417 - (nullable NSURL *)containerURLForSecurityApplicationGroupIdentifier:(NSString *)groupIdentifier;
419 - (nullable NSArray<NSURL*>*)contentsOfDirectoryAtURL:(NSURL *)url includingPropertiesForKeys:(nullable NSArray<
GD_NSURLResourceKey>*)keys options:(NSDirectoryEnumerationOptions)mask error:(NSError **)error;
421 - (nullable NSArray<NSString*>*)contentsOfDirectoryAtPath:(NSString *)path error:(NSError **)error;
423 - (nullable NSDirectoryEnumerator<NSURL *> *)enumeratorAtURL:(NSURL *)url includingPropertiesForKeys:(nullable NSArray<
GD_NSURLResourceKey> *)keys options:(NSDirectoryEnumerationOptions)mask errorHandler:(nullable BOOL (^)(NSURL * url, NSError * error))handler;
425 - (nullable NSDirectoryEnumerator<NSString *> *)enumeratorAtPath:(NSString *)path;
427 - (nullable NSArray<NSString*> *)subpathsOfDirectoryAtPath:( NSString *)pathRaw error:(NSError **)error;
429 - (nullable NSArray<NSString*> *)subpathsAtPath:( NSString *)path;
433 - (BOOL)createDirectoryAtURL:( NSURL *)url withIntermediateDirectories:(BOOL)createIntermediates attributes:(nullable NSDictionary<NSString*,
id>*)attributes error:(NSError **)error;
435 - (BOOL)createDirectoryAtPath:( NSString*)path withIntermediateDirectories:(BOOL) createIntermediates attributes:(nullable NSDictionary<NSString*,
id>*)attributes error:(NSError **)error;
437 - (BOOL)createFileAtPath:( NSString *)path contents:(nullable NSData *)contents attributes:(nullable NSDictionary<NSString*,
id>*)attributes;
439 - (BOOL)removeItemAtURL:( NSURL *)URL error:(NSError **)error;
441 - (BOOL)removeItemAtPath:( NSString*)filePath error:(NSError **)error;
443 - (BOOL)replaceItemAtURL:( NSURL *)originalItemURL withItemAtURL:( NSURL *)newItemURL backupItemName:(nullable NSString *)backupItemName options:(NSFileManagerItemReplacementOptions)options resultingItemURL:(NSURL * _Nullable * _Nullable)resultingURL error:(NSError **)error;
447 - (BOOL)copyItemAtURL:( NSURL *)srcURL toURL:( NSURL *)dstURL error:(NSError **)error;
449 - (BOOL)copyItemAtPath:( NSString *)srcPath toPath:( NSString *)dstPath error:(NSError **)error;
451 - (BOOL)moveItemAtURL:( NSURL *)srcURL toURL:( NSURL *)dstURL error:(NSError **)error;
453 - (BOOL)moveItemAtPath:( NSString*)srcPath toPath:( NSString*)dstPath error:(NSError **)error;
456 #if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
468 #if defined(__MAC_10_12)
469 - (nullable NSURL *)homeDirectoryForUser:(NSString *)userName GD_API_AVAILABLE(macosx(10.12)) GD_API_UNAVAILABLE(ios, watchos, tvos);
483 @property(nullable, readonly, copy, atomic) id<NSObject, NSCopying, NSSecureCoding> ubiquityIdentityToken;
492 - (nullable NSURL *)URLForUbiquityContainerIdentifier:(nullable NSString *)containerIdentifier;
501 - (BOOL)isUbiquitousItemAtURL:( NSURL *)url;
511 - (BOOL)setUbiquitous:(BOOL)flag itemAtURL:( NSURL *)url destinationURL:( NSURL *)destinationURL error:(NSError **)error;
521 - (BOOL)startDownloadingUbiquitousItemAtURL:( NSURL *)url error:(NSError **)error;
531 - (BOOL)evictUbiquitousItemAtURL:( NSURL *)url error:(NSError **)error;
541 - (nullable NSURL *)URLForPublishingUbiquitousItemAtURL:( NSURL *)url expirationDate:(NSDate * _Nullable * _Nullable)outDate error:(NSError **)error;
554 #if defined(__MAC_10_13) || defined(__IPHONE_11_0)
555 - (void)getFileProviderServicesForItemAtURL:(NSURL *)url completionHandler:(
void (^)(NSDictionary<NSFileProviderServiceName,NSFileProviderService *> *services, NSError *error))completionHandler UNAVAILABLE_IN_GDFILEMANAGER;
566 #if defined(__MAC_10_12) || defined(__IPHONE_10_0)
567 @property(readonly, copy, atomic) NSURL *temporaryDirectory UNAVAILABLE_IN_GDFILEMANAGER;
572 - (BOOL)createSymbolicLinkAtURL:( NSURL *)url withDestinationURL:( NSURL *)destURL error:(NSError **)error;
574 - (BOOL)createSymbolicLinkAtPath:( NSString *)path withDestinationPath:( NSString *)destPath error:(NSError **)error;
576 - (BOOL)linkItemAtURL:( NSURL *)srcURL toURL:( NSURL *)dstURL error:(NSError **)error;
578 - (BOOL)linkItemAtPath:( NSString *)srcPath toPath:( NSString *)dstPath error:(NSError **)error;
580 - (nullable NSString *)destinationOfSymbolicLinkAtPath:( NSString *)path error:(NSError **)error;
584 - (BOOL)fileExistsAtPath:( NSString *)path;
586 - (BOOL)fileExistsAtPath:( NSString*)path isDirectory:(nullable BOOL*)isDirectory;
588 - (BOOL)isReadableFileAtPath:( NSString *)path;
590 - (BOOL)isWritableFileAtPath:( NSString *)path;
592 - (BOOL)isExecutableFileAtPath:( NSString *)path;
594 - (BOOL)isDeletableFileAtPath:( NSString *)path;
596 - (nullable NSDictionary<
GD_NSFileAttributeKey, id> *)attributesOfItemAtPath:( NSString *)path error:(NSError **)error;
598 - (nullable NSDictionary<
GD_NSFileAttributeKey, id> *)attributesOfFileSystemForPath:( NSString *)path error:(NSError **)error;
600 - (BOOL)setAttributes:( NSDictionary<
GD_NSFileAttributeKey,
id> *)attributes ofItemAtPath:( NSString *)path error:(NSError **)error;
604 - (nullable NSData *)contentsAtPath:( NSString *)path;
606 - (BOOL)contentsEqualAtPath:( NSString *)path1 andPath:( NSString *)path2;
610 - ( const
char *)fileSystemRepresentationWithPath:( NSString *)path NS_RETURNS_INNER_POINTER;
612 - ( NSString *)stringWithFileSystemRepresentation:( const
char *)string length:(NSUInteger)len;
616 - (BOOL)changeCurrentDirectoryPath:( NSString *)path;
618 - ( NSString *)currentDirectoryPath;
628 - (BOOL)changeFileAttributes:( NSDictionary *)attributes atPath:( NSString *)path DEPRECATED_IN_NSFILEMANAGER;
636 - (nullable NSDictionary *)fileAttributesAtPath:( NSString *)path traverseLink:(BOOL)flag DEPRECATED_IN_NSFILEMANAGER;
644 - (nullable NSDictionary *)fileSystemAttributesAtPath:( NSString *)path DEPRECATED_IN_NSFILEMANAGER;
652 - (nullable NSArray *)directoryContentsAtPath:( NSString *)path DEPRECATED_IN_NSFILEMANAGER;
660 - (BOOL)createDirectoryAtPath:( NSString *)path attributes:( NSDictionary *)attributes DEPRECATED_IN_NSFILEMANAGER;
668 - (BOOL)createSymbolicLinkAtPath:( NSString *)path pathContent:( NSString *)otherPath DEPRECATED_IN_NSFILEMANAGER;
676 - (nullable NSString *)pathContentOfSymbolicLinkAtPath:( NSString *)path DEPRECATED_IN_NSFILEMANAGER;
680 NS_ASSUME_NONNULL_END