lpw
2022-02-15 2e29a3a585524a054640bb6e7bdf26fe77ba1f17
commit | author | age
2e29a3 1 /*
L 2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  * All rights reserved.
4  *
5  * This source code is licensed under the license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8
9 #import <Foundation/Foundation.h>
10
11 NS_ASSUME_NONNULL_BEGIN
12
13 /// An internal protocol used to describe a file manager
14 NS_SWIFT_NAME(FileManaging)
15 @protocol FBSDKFileManaging
16
17 - (nullable NSURL *)URLForDirectory:(NSSearchPathDirectory)directory
18                            inDomain:(NSSearchPathDomainMask)domain
19                   appropriateForURL:(NSURL *)url
20                              create:(BOOL)shouldCreate
21                               error:(NSError *_Nullable *)error;
22
23 - (BOOL)createDirectoryAtPath:(NSString *)path
24   withIntermediateDirectories:(BOOL)createIntermediates
25                    attributes:(NSDictionary<NSFileAttributeKey, id> *_Nullable)attributes
26                         error:(NSError *_Nullable *)error;
27
28 - (BOOL)fileExistsAtPath:(NSString *)path;
29
30 - (BOOL)removeItemAtPath:(NSString *)path
31                    error:(NSError *_Nullable *)error;
32
33 - (NSArray<NSString *> *)contentsOfDirectoryAtPath:(NSString *)path
34                                              error:(NSError *_Nullable *)error;
35
36 @end
37
38 @interface NSFileManager (FBSDKFileManaging) <FBSDKFileManaging>
39 @end
40
41 NS_ASSUME_NONNULL_END