// SPDX-License-Identifier: GPL-3.0-or-later #import NS_ASSUME_NONNULL_BEGIN /// Synchronous, bounded operations on caller-owned private working images. /// Call off the main thread. Internal serialization protects retained C code. @interface VCCDiskImageEditorBackend : NSObject /// Discover validated volumes in a raw floppy/hard-drive image. IDs encode the /// filesystem, byte offset and extent; all regions outside the selected volume /// remain opaque and are never reformatted or inferred as free space. + (nullable NSArray *> *)discoverVolumesAtURL:(NSURL *)imageURL error:(NSError **)error NS_SWIFT_NAME(discoverVolumes(at:)); + (BOOL)extractVolume:(NSString *)volumeID imageURL:(NSURL *)imageURL outputURL:(NSURL *)outputURL error:(NSError **)error NS_SWIFT_NAME(extractVolume(_:imageURL:outputURL:)); + (BOOL)replaceVolume:(NSString *)volumeID imageURL:(NSURL *)imageURL volumeURL:(NSURL *)volumeURL error:(NSError **)error NS_SWIFT_NAME(replaceVolume(_:imageURL:volumeURL:)); + (nullable NSDictionary *)inspectImageAtURL:(NSURL *)imageURL error:(NSError **)error NS_SWIFT_NAME(inspectImage(at:)); + (nullable NSArray *> *)listDirectory:(NSString *)directory imageURL:(NSURL *)imageURL error:(NSError **)error NS_SWIFT_NAME(listDirectory(_:imageURL:)); + (nullable NSData *)readFile:(NSString *)path imageURL:(NSURL *)imageURL error:(NSError **)error NS_SWIFT_NAME(readFile(_:imageURL:)); + (nullable NSString *)identifyFile:(NSString *)path imageURL:(NSURL *)imageURL error:(NSError **)error NS_SWIFT_NAME(identifyFile(_:imageURL:)); + (BOOL)importData:(NSData *)data named:(NSString *)name directory:(NSString *)directory imageURL:(NSURL *)imageURL fileType:(NSInteger)fileType ascii:(BOOL)ascii replace:(BOOL)replace error:(NSError **)error NS_SWIFT_NAME(importData(_:named:directory:imageURL:fileType:ascii:replace:)); + (BOOL)makeDirectory:(NSString *)name inDirectory:(NSString *)directory imageURL:(NSURL *)imageURL error:(NSError **)error NS_SWIFT_NAME(makeDirectory(_:in:imageURL:)); + (BOOL)renameEntry:(NSString *)path toName:(NSString *)name imageURL:(NSURL *)imageURL error:(NSError **)error NS_SWIFT_NAME(renameEntry(_:to:imageURL:)); + (BOOL)deleteEntry:(NSString *)path directory:(BOOL)directory imageURL:(NSURL *)imageURL error:(NSError **)error NS_SWIFT_NAME(deleteEntry(_:directory:imageURL:)); /// Relink regular files within one OS-9 image without copying their data or /// replacing descriptors. The empty destination path denotes the root. + (BOOL)moveFiles:(NSArray *)paths toDirectory:(NSString *)directory imageURL:(NSURL *)imageURL error:(NSError **)error NS_SWIFT_NAME(moveFiles(_:toDirectory:imageURL:)); /// OS-9's two-byte owner is represented as high-byte group / low-byte user. /// Permissions are owner/public rwx and single access (0...127); type is kept. + (BOOL)setOS9MetadataForPath:(NSString *)path imageURL:(NSURL *)imageURL ownerUser:(NSInteger)ownerUser ownerGroup:(NSInteger)ownerGroup permissions:(NSInteger)permissions error:(NSError **)error NS_SWIFT_NAME(setOS9Metadata(for:imageURL:ownerUser:ownerGroup:permissions:)); @end NS_ASSUME_NONNULL_END