File tree 2 files changed +23
-2
lines changed
Sources/Shared/Toolkit/Data
2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,16 @@ import Foundation
8
8
9
9
/// A container provides access to a list of `Resource` entries.
10
10
public protocol Container : Closeable {
11
- /// Direct source to this container, when available.
11
+ /// URL locating this container, when available.
12
+ ///
13
+ /// This can be used to optimize access to a container's content for the
14
+ /// caller. For example if the container is available on the local file
15
+ /// system, a caller might prefer using a file handle instead of the
16
+ /// ``Container`` API.
17
+ ///
18
+ /// Note that this must represent the same content available in
19
+ /// ``Container``. If you transform the resources content on the fly (e.g.
20
+ /// with ``TransformingContainer``), then the `sourceURL` becomes nil.
12
21
var sourceURL : AbsoluteURL ? { get }
13
22
14
23
/// List of all the container entries.
Original file line number Diff line number Diff line change @@ -8,7 +8,19 @@ import Foundation
8
8
9
9
/// Acts as a proxy to an actual resource by handling read access.
10
10
public protocol Resource : Streamable {
11
- /// URL locating this resource, if any.
11
+ /// URL locating this resource, when available.
12
+ ///
13
+ /// This can be used to optimize access to a resource's content for the
14
+ /// caller. For example if the resource is available on the local file
15
+ /// system, a caller might prefer using a file handle instead of the
16
+ /// ``Resource`` API.
17
+ ///
18
+ /// Note that this must represent the same content available in
19
+ /// ``Resource``. If you transform the resources content on the fly (e.g.
20
+ /// with ``TransformingResource``), then the `sourceURL` becomes nil.
21
+ ///
22
+ /// A ``Resource`` located in a ZIP archive will have a nil `sourceURL`, as
23
+ /// there is no direct access to the ZIP entry using an absolute URL.
12
24
var sourceURL : AbsoluteURL ? { get }
13
25
14
26
/// Properties associated to the resource.
You can’t perform that action at this time.
0 commit comments