Files

30 lines
3.1 KiB
Objective-C

// SPDX-License-Identifier: GPL-3.0-or-later
#import <Foundation/Foundation.h>
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<NSDictionary<NSString *, id> *> *)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<NSString *, id> *)inspectImageAtURL:(NSURL *)imageURL error:(NSError **)error NS_SWIFT_NAME(inspectImage(at:));
+ (nullable NSArray<NSDictionary<NSString *, id> *> *)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<NSString *> *)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