Skip to content

Commit 2bca980

Browse files
committed
Update code comments
1 parent 7e7f9a0 commit 2bca980

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

Sources/Shared/Toolkit/Data/Container/Container.swift

+10-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@ import Foundation
88

99
/// A container provides access to a list of `Resource` entries.
1010
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.
1221
var sourceURL: AbsoluteURL? { get }
1322

1423
/// List of all the container entries.

Sources/Shared/Toolkit/Data/Resource/Resource.swift

+13-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,19 @@ import Foundation
88

99
/// Acts as a proxy to an actual resource by handling read access.
1010
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.
1224
var sourceURL: AbsoluteURL? { get }
1325

1426
/// Properties associated to the resource.

0 commit comments

Comments
 (0)