mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-02-24 08:34:58 +01:00
removed Nimble
This commit is contained in:
@@ -64,7 +64,7 @@ public final class LegacySQLiteStore: SQLiteStore {
|
||||
public required init(fileName: String, configuration: String? = nil, mappingModelBundles: [NSBundle] = NSBundle.allBundles(), resetStoreOnModelMismatch: Bool = false) {
|
||||
|
||||
super.init(
|
||||
fileURL: LegacySQLiteStore.legacyDefaultRootDirectory.URLByAppendingPathComponent(
|
||||
fileURL: LegacySQLiteStore.defaultRootDirectory.URLByAppendingPathComponent(
|
||||
fileName,
|
||||
isDirectory: false
|
||||
),
|
||||
@@ -75,6 +75,30 @@ public final class LegacySQLiteStore: SQLiteStore {
|
||||
}
|
||||
|
||||
|
||||
// MARK: SQLiteStore
|
||||
|
||||
internal override class var defaultRootDirectory: NSURL {
|
||||
|
||||
#if os(tvOS)
|
||||
let systemDirectorySearchPath = NSSearchPathDirectory.CachesDirectory
|
||||
#else
|
||||
let systemDirectorySearchPath = NSSearchPathDirectory.ApplicationSupportDirectory
|
||||
#endif
|
||||
|
||||
return NSFileManager.defaultManager().URLsForDirectory(
|
||||
systemDirectorySearchPath,
|
||||
inDomains: .UserDomainMask
|
||||
).first!
|
||||
}
|
||||
|
||||
internal override class var defaultFileURL: NSURL {
|
||||
|
||||
return LegacySQLiteStore.defaultRootDirectory
|
||||
.URLByAppendingPathComponent(DataStack.applicationName, isDirectory: false)
|
||||
.URLByAppendingPathExtension("sqlite")
|
||||
}
|
||||
|
||||
|
||||
// MARK: DefaultInitializableStore
|
||||
|
||||
/**
|
||||
@@ -83,24 +107,6 @@ public final class LegacySQLiteStore: SQLiteStore {
|
||||
*/
|
||||
public required init() {
|
||||
|
||||
super.init(fileURL: LegacySQLiteStore.legacyDefaultFileURL)
|
||||
super.init(fileURL: LegacySQLiteStore.defaultFileURL)
|
||||
}
|
||||
|
||||
|
||||
// MARK: Internal
|
||||
|
||||
#if os(tvOS)
|
||||
internal static let systemDirectorySearchPath = NSSearchPathDirectory.CachesDirectory
|
||||
#else
|
||||
internal static let systemDirectorySearchPath = NSSearchPathDirectory.ApplicationSupportDirectory
|
||||
#endif
|
||||
|
||||
internal static let legacyDefaultRootDirectory = NSFileManager.defaultManager().URLsForDirectory(
|
||||
LegacySQLiteStore.systemDirectorySearchPath,
|
||||
inDomains: .UserDomainMask
|
||||
).first!
|
||||
|
||||
internal static let legacyDefaultFileURL = LegacySQLiteStore.legacyDefaultRootDirectory
|
||||
.URLByAppendingPathComponent(DataStack.applicationName, isDirectory: false)
|
||||
.URLByAppendingPathExtension("sqlite")
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ public class SQLiteStore: LocalStorage, DefaultInitializableStore {
|
||||
|
||||
// MARK: Internal
|
||||
|
||||
internal static let defaultRootDirectory: NSURL = {
|
||||
internal class var defaultRootDirectory: NSURL {
|
||||
|
||||
#if os(tvOS)
|
||||
let systemDirectorySearchPath = NSSearchPathDirectory.CachesDirectory
|
||||
@@ -163,14 +163,14 @@ public class SQLiteStore: LocalStorage, DefaultInitializableStore {
|
||||
NSBundle.mainBundle().bundleIdentifier ?? "com.CoreStore.DataStack",
|
||||
isDirectory: true
|
||||
)
|
||||
}()
|
||||
}
|
||||
|
||||
internal static let defaultFileURL: NSURL = {
|
||||
internal class var defaultFileURL: NSURL {
|
||||
|
||||
let applicationName = (NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleName") as? String) ?? "CoreData"
|
||||
|
||||
return SQLiteStore.defaultRootDirectory
|
||||
.URLByAppendingPathComponent(applicationName, isDirectory: false)
|
||||
.URLByAppendingPathExtension("sqlite")
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user