mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Propagate Reflectable docs
230 undocumented public non-operator APIs remain in core Swift SVN r22236
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
}%
|
||||
|
||||
extension ${introspecteeType} : Reflectable {
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
return _${introspecteeType}Mirror(self)
|
||||
}
|
||||
|
||||
@@ -553,6 +553,7 @@ func _${Self}Extend<
|
||||
}
|
||||
|
||||
extension ${Self} : Reflectable {
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
return _ArrayTypeMirror(self)
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public enum Bit : Int, RandomAccessIndexType, Reflectable {
|
||||
return rawValue.advancedBy(distance) > 0 ? One : Zero
|
||||
}
|
||||
|
||||
/// Reflection
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
return _BitMirror(self)
|
||||
}
|
||||
|
||||
@@ -2333,6 +2333,7 @@ class _DictionaryMirror<Key : Hashable,Value> : MirrorType {
|
||||
}
|
||||
|
||||
extension Dictionary : Reflectable {
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
return _DictionaryMirror(self)
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ public enum ImplicitlyUnwrappedOptional<T>
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
// FIXME: This should probably use _OptionalMirror in both cases.
|
||||
if let value = self {
|
||||
|
||||
@@ -108,6 +108,7 @@ public struct ${Self}<T: Comparable>
|
||||
}
|
||||
|
||||
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
return _IntervalMirror(self)
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
% for Type in Types:
|
||||
extension ${Type[0]} : Reflectable {
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
return _LeafMirror(self, { "\($0)" }, { .Some(${Type[1]}(${Type[2]})) })
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ public enum Optional<T> : Reflectable, NilLiteralConvertible {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
return _OptionalMirror(self)
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public protocol Reflectable {
|
||||
// witness tables are laid out. Changing this protocol requires a
|
||||
// corresponding change to Reflection.cpp.
|
||||
|
||||
/// Get a mirror that reflects `self`.
|
||||
/// Returns a mirror that reflects `self`.
|
||||
func getMirror() -> MirrorType
|
||||
}
|
||||
|
||||
|
||||
@@ -455,6 +455,7 @@ extension String : CollectionType {
|
||||
return endIndexUTF16 - graphemeClusterStartUTF16
|
||||
}
|
||||
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
return _IndexMirror(self)
|
||||
}
|
||||
|
||||
@@ -104,6 +104,7 @@ extension String {
|
||||
self._core = _core
|
||||
}
|
||||
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
return _UTF16ViewMirror(self)
|
||||
}
|
||||
|
||||
@@ -154,6 +154,7 @@ extension String {
|
||||
return IndexingGenerator(self)
|
||||
}
|
||||
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
return _UTF8ViewMirror(self)
|
||||
}
|
||||
|
||||
@@ -158,6 +158,7 @@ extension String {
|
||||
return Generator(_core.generate())
|
||||
}
|
||||
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
return _UnicodeScalarViewMirror(self)
|
||||
}
|
||||
|
||||
@@ -120,6 +120,7 @@ struct _NSViewMirror : MirrorType {
|
||||
}
|
||||
|
||||
extension NSView : Reflectable {
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
return _NSViewMirror(self)
|
||||
}
|
||||
|
||||
@@ -142,6 +142,7 @@ public let CGFLOAT_MIN = CGFloat.min
|
||||
public let CGFLOAT_MAX = CGFloat.max
|
||||
|
||||
extension CGFloat : Reflectable {
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
return reflect(native)
|
||||
}
|
||||
|
||||
@@ -127,17 +127,20 @@ ${getMirrorConformance("NSDate")}
|
||||
${getMirrorConformance("NSSet","MembershipContainer")}
|
||||
|
||||
extension NSArray : Reflectable {
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
return reflect(self as [AnyObject])
|
||||
}
|
||||
}
|
||||
extension NSDictionary : Reflectable {
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
let dict: [NSObject : AnyObject] = _convertNSDictionaryToDictionary(self)
|
||||
return reflect(dict)
|
||||
}
|
||||
}
|
||||
extension NSString : Reflectable {
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
return reflect(self as String)
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ public struct ObjCBool : BooleanType, BooleanLiteralConvertible {
|
||||
}
|
||||
|
||||
extension ObjCBool : Reflectable {
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
return reflect(boolValue)
|
||||
}
|
||||
@@ -154,6 +155,7 @@ extension String {
|
||||
}
|
||||
|
||||
extension Selector : Reflectable {
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public
|
||||
func getMirror() -> MirrorType {
|
||||
return reflect(String(_sel: self))
|
||||
|
||||
@@ -186,6 +186,7 @@ struct _UIViewMirror : MirrorType {
|
||||
}
|
||||
|
||||
extension UIView : Reflectable {
|
||||
/// Returns a mirror that reflects `self`.
|
||||
public func getMirror() -> MirrorType {
|
||||
return _UIViewMirror(self)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user