CBLFileStorage

Objective-C

@protocol CBLFileStorage <NSObject>

Swift

protocol FileStorage : NSObjectProtocol

Represents a file storage container in a camera, such as an SD card.

  • Returns the description of the storage container as reported by the camera.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *storageDescription;

    Swift

    var storageDescription: String? { get }
  • Returns the volume label of the storage container as reported by the camera. Can be nil.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *label;

    Swift

    var label: String? { get }
  • Returns a name string appropriate for display to the user.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *displayName;

    Swift

    var displayName: String? { get }
  • Returns the free space of the storage container, in bytes.

    Declaration

    Objective-C

    @property (nonatomic, readonly) uint64_t availableSpace;

    Swift

    var availableSpace: UInt64 { get }
  • Returns the capacity of the storage container, in bytes.

    Declaration

    Objective-C

    @property (nonatomic, readonly) uint64_t capacity;

    Swift

    var capacity: UInt64 { get }
  • The physical slot the file storage object occupies.

    Declaration

    Objective-C

    @property (nonatomic, readonly) CBLStorageSlot slot;

    Swift

    var slot: StorageSlot { get }
  • Returns YES if the storage container allows write access, otherwise NO.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL allowsWrite;

    Swift

    var allowsWrite: Bool { get }
  • Returns YES if the storage container contains images that the camera is incapable of transferring.

    For example, some older Panasonic models will list RAW images, but aren’t capable of transferring them. These images are ignored by CascableCore, but it may lead to user confusion if they’re presented with an empty list.

    This property can be useful to provide the user context as to why no images are available.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL hasInaccessibleImages;

    Swift

    var hasInaccessibleImages: Bool { get }
  • If available, returns the overall progress of the storage device’s cataloging progress. This is not neccessarily tied to any particular loadChildren call.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSProgress *catalogProgress;

    Swift

    var catalogProgress: Progress? { get }
  • Returns the camera associated with this storage.

    Declaration

    Objective-C

    @property (nonatomic, weak, readonly, nullable) id<CBLCamera> camera;

    Swift

    weak var camera: (any Camera)? { get }
  • Returns the root directory of this storage.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nonnull) id<CBLFileSystemFolderItem> rootDirectory;

    Swift

    var rootDirectory: any FileSystemFolderItem { get }
  • Add an observer to the storage’s filesystem.

    The registered observer block will be called on the main queue.

    Note

    Changes in directories that haven’t had their children loaded at least once will not trigger a notification.

    Declaration

    Objective-C

    - (CBLFileStorageObserverToken *_Nonnull)addFileSystemObserver:
        (nonnull CBLFileStorageFilesModifiedObserver)observer;

    Swift

    func addFileSystemObserver(_ observer: @escaping FileStorageFilesModifiedObserver) -> String

    Parameters

    observer

    The observer block to be called when the filesystem changes.

    Return Value

    Returns an observer token to be used when removing the observer.

  • Remove an observer to the storage’s filesystem.

    Note

    It is safe for a triggered observer block to remove itself during execution, allowing easy one-shot observations.

    Declaration

    Objective-C

    - (void)removeFileSystemObserverWithToken:
        (nonnull CBLFileStorageObserverToken *)observer;

    Swift

    func removeFileSystemObserver(withToken observer: String)

    Parameters

    observer

    The existing observer token to remove.