Cog/Utils/SandboxBroker.h
Christopher Snowhill 77b3d74948 [Sandbox Paths] Automatically clean up old paths
Clean up redundant paths automatically, and on startup. Also refresh the
preferences dialog path list every time it is opened.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-07-24 23:14:52 -07:00

38 lines
733 B
Objective-C

//
// SandboxBroker.h
// Cog
//
// Created by Christopher Snowhill on 6/20/22.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SandboxBroker : NSObject {
NSMutableArray *storage;
}
+ (SandboxBroker *)sharedSandboxBroker;
+ (NSURL *)urlWithoutFragment:(NSURL *)url;
+ (BOOL)isPath:(NSURL *)path aSubdirectoryOf:(NSURL *)directory;
+ (void)cleanupFolderAccess;
- (id)init;
- (void)shutdown;
- (void)addFolderIfMissing:(NSURL *)folderUrl;
- (void)addFileIfMissing:(NSURL *)fileUrl;
- (void)requestFolderForFile:(NSURL *)fileUrl;
- (const void *)beginFolderAccess:(NSURL *)fileUrl;
- (void)endFolderAccess:(const void *)handle;
- (BOOL)areAllPathsSafe:(NSArray *)urls;
@end
NS_ASSUME_NONNULL_END