PersistentStoreManaging

public protocol PersistentStoreManaging : AnyObject

Implementers must implement this for manage the persistent store.

  • Tries to create store with the given password. After creation opens the store and will be ready to use.

    Throws

    StoreManagerError

    Declaration

    Swift

    func createStore(name: String, passcode: String?) throws -> DataStoring

    Parameters

    name

    name of the store

    passcode

    the passcode given by the user

    Return Value

    created store

  • Tries to open the store with the given passcode

    Throws

    StoreManagerError

    Declaration

    Swift

    func openStore(name: String, passcode: String?) throws -> DataStoring

    Parameters

    name

    name of the store

    passcode

    the passcode given by the user

    Return Value

    opened store

  • Removes the given store from the FileManager, if exists Before deletion, the store will be closed anyway

    Throws

    StoreManagerError

    Declaration

    Swift

    func removeStore(name: String, store: DataStoring?) throws

    Parameters

    name

    name of the store

    store

    the store to remove, conforms to DataStoring protocol

  • Change the encryption of the given store

    Throws

    StoreManagerError

    Declaration

    Swift

    func changePasscode(store: DataStoring, newPasscode: String?) throws

    Parameters

    store

    the store whose passcode has to be changed, conforms to DataStoring protocol

    newPasscode

    the new passcode as encryptionkey

  • Checks if the store exists for the given name.

    Declaration

    Swift

    func storeExists(name: String) throws -> Bool

    Parameters

    name

    name of the store

    Return Value

    true if the store exists, false otherwise