RBFileChangeMonitor Class Reference

Inherits from NSObject
Declared in RBFileChangeMonitor.h

Overview

Detects changes in a set of files.

  storageKey

The unique storage key for this file change monitor. Checksums are stored here.

@property (nonatomic, readonly, nonnull) NSString *storageKey

Declared In

RBFileChangeMonitor.h

– initWithStorageKey:

Initializes a new file change monitor with the given unique storage key.

- (nonnull instancetype)initWithStorageKey:(nonnull NSString *)storageKey

Parameters

storageKey

The unique storage key to use when determining where to store the checksums.

Return Value

The initialized object.

Declared In

RBFileChangeMonitor.h

– checkIfChangesOccurredInFiles:modifiedFiles:newFiles:removedFiles:

Checks for changes to the given files and internally tracks the changes. You may call saveChecksums after calling this method to save the internally tracked values.

- (BOOL)checkIfChangesOccurredInFiles:(nonnull NSArray<NSURL*> *)fileUrls modifiedFiles:(NSArray<NSURL*> *__nullable *__nullable)modifiedFileUrls newFiles:(NSArray<NSURL*> *__nullable *__nullable)newFileUrls removedFiles:(NSArray<NSURL*> *__nullable *__nullable)removedFileUrls

Parameters

fileUrls

The URLs to the files to check for changes in.

modifiedFileUrls

An optional NSArray* in which to store the URLs to the files that were modified.

newFileUrls

An optional NSArray* in which to store the URLs to the files that are new.

removedFileUrls

An optional NSArray* in which to store the URLs to the files that were removed.

Return Value

Whether or not any changes were detected.

Declared In

RBFileChangeMonitor.h

– saveChecksums

Saves internally tracked changes if there are any.

- (void)saveChecksums

Declared In

RBFileChangeMonitor.h