Storage
public final class Storage : Codable, FactoryInitializable
The shared, immutable storage of a SourceFile.
unowned Storage can be used safely anywhere, because every Storage instance is owned by a
threadsafe global dictionary, Storage.allInstances, and never deallocated.
-
The URL of the source file.
Declaration
Swift
fileprivate let url: URL -
The contents of the source file.
Declaration
Swift
fileprivate let text: Substring -
The start position of each line.
Declaration
Swift
fileprivate let lineStarts: [Index] -
Creates an instance with the given properties;
self.lineStartswill be computed if lineStarts isnil.Declaration
Swift
private init(url: URL, lineStarts: [Index]?, text: Substring) -
The owner of all instances of
Storage.Declaration
Swift
private static let allInstances: SharedMutable<[URL : SourceFile.Storage]> -
The data that is encoded/decoded for each instance of
See moreself.Declaration
Swift
private struct Encoding : Codable -
Declaration
Swift
public required convenience init(from decoder: Decoder) throws -
Declaration
Swift
public func encode(to encoder: Encoder) throws
View on GitHub