mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
-Hide vars that have a private type. -Hide functions that have a parameter with private type or a parameter name with leading underscore. -Minor change in StringUTF16.swift to avoid printing "func generate() -> IndexingGenerator<_StringCore>". rdar://17027294 Swift SVN r18623
46 lines
1.3 KiB
Swift
46 lines
1.3 KiB
Swift
//===--- StringUTF16.swift ------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See http://swift.org/LICENSE.txt for license information
|
|
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
extension String {
|
|
struct UTF16View : Sliceable {
|
|
var startIndex: Int {
|
|
return _core.startIndex
|
|
}
|
|
var endIndex: Int {
|
|
return _core.endIndex
|
|
}
|
|
|
|
// This is to avoid printing "func generate() -> IndexingGenerator<_StringCore>"
|
|
typealias _GeneratorType = _StringCore.GeneratorType
|
|
typealias GeneratorType = _GeneratorType
|
|
|
|
func generate() -> GeneratorType {
|
|
return _core.generate()
|
|
}
|
|
subscript(i: Int) -> GeneratorType.Element {
|
|
return _core[i]
|
|
}
|
|
subscript(subRange: Range<Int>) -> UTF16View {
|
|
return UTF16View(_core[subRange])
|
|
}
|
|
|
|
init(_ _core: _StringCore) {
|
|
self._core = _core
|
|
}
|
|
|
|
let _core: _StringCore
|
|
}
|
|
|
|
var utf16: UTF16View {
|
|
return UTF16View(core)
|
|
}
|
|
}
|