UnicodeScalar

struct UnicodeScalar
Inheritance Comparable, DebugPrintable, Equatable, Hashable, Printable, Reflectable, Streamable, UnicodeScalarLiteralConvertible, _Comparable View Protocol Hierarchy →
Import import Swift

Initializers

init()

Creates an instance of the NUL scalar value.

Declaration

init()
init(_: Int)

Construct with value v.

Requires: v is a valid unicode scalar value.

Declaration

init(_ v: Int)
init(_: UInt8)

Create an instance with numeric value v.

Declaration

init(_ v: UInt8)
init(_: UInt16)

Create an instance with numeric value v.

Requires: v is a valid Unicode scalar value.

Declaration

init(_ v: UInt16)
init(_: UInt32)

Create an instance with numeric value v.

Requires: v is a valid Unicode scalar value.

Declaration

init(_ v: UInt32)
init(_: UnicodeScalar)

Create a duplicate of v.

Declaration

init(_ v: UnicodeScalar)
init(_builtinUnicodeScalarLiteral:)

Declaration

init(_builtinUnicodeScalarLiteral value: Builtin.Int32)
init(unicodeScalarLiteral:)

Create an instance initialized to value.

Declaration

init(unicodeScalarLiteral value: UnicodeScalar)

Instance Variables

var debugDescription: String

A textual representation of self, suitable for debugging.

Declaration

var debugDescription: String { get }
var description: String

A textual representation of self.

Declaration

var description: String { get }
var hashValue: Int

The hash value.

Axiom: x == y implies x.hashValue == y.hashValue

Note: the hash value is not guaranteed to be stable across different invocations of the same program. Do not persist the hash value across program runs.

Declaration

var hashValue: Int { get }
var value: UInt32

A numeric representation of self.

Declaration

var value: UInt32 { get }

Instance Methods

func escape(_:)

Return a String representation of self .

asASCII, if true, forces most values into a numeric representation.

Declaration

func escape(#asASCII: Bool) -> String
func getMirror()

Returns a mirror that reflects self.

Declaration

func getMirror() -> MirrorType
func isASCII()

Returns true if this is an ASCII character (code point 0 to 127 inclusive).

Declaration

func isASCII() -> Bool
func writeTo(inout:)

Write a textual representation of self into target

Declaration

func writeTo<Target : OutputStreamType>(inout target: Target)