0001    //
0002    //  StringUtils.swift
0003    //  JsonSerializer
0004    //
0005    //  Created by Fuji Goro on 2014/09/15.
0006    //  Copyright (c) 2014 Fuji Goro. All rights reserved.
0007    //
0008    
0009    let unescapeMapping
JsonParser.swift:154
            return unescapeMapping[character] ?? character
: [UnicodeScalar: UnicodeScalar] = [ 0010 "t": "\t", 0011 "r": "\r", 0012 "n": "\n", 0013 ] 0014 0015 let escapeMapping
StringUtils.swift:64
            .map { escapeMapping[$0] ?? String($0) }
: [Character : String] = [ 0016 "\r": "\\r", 0017 "\n": "\\n", 0018 "\t": "\\t", 0019 "\\": "\\\\", 0020 "\"": "\\\"", 0021 0022 "\u{2028}": "\\u2028", // LINE SEPARATOR 0023 "\u{2029}": "\\u2029", // PARAGRAPH SEPARATOR 0024 0025 // XXX: countElements("\r\n") is 1 in Swift 1.0 0026 "\r\n": "\\r\\n", 0027 ] 0028 0029 let hexMapping
StringUtils.swift:79
    return hexMapping[UnicodeScalar(b)]
: [UnicodeScalar : UInt32] = [ 0030 "0": 0x0, 0031 "1": 0x1, 0032 "2": 0x2, 0033 "3": 0x3, 0034 "4": 0x4, 0035 "5": 0x5, 0036 "6": 0x6, 0037 "7": 0x7, 0038 "8": 0x8, 0039 "9": 0x9, 0040 "a": 0xA, "A": 0xA, 0041 "b": 0xB, "B": 0xB, 0042 "c": 0xC, "C": 0xC, 0043 "d": 0xD, "D": 0xD, 0044 "e": 0xE, "E": 0xE, 0045 "f": 0xF, "F": 0xF, 0046 ] 0047 0048 let digitMapping
StringUtils.swift:75
    return digitMapping[UnicodeScalar(b)]
: [UnicodeScalar:Int] = [ 0049 "0": 0, 0050 "1": 1, 0051 "2": 2, 0052 "3": 3, 0053 "4": 4, 0054 "5": 5, 0055 "6": 6, 0056 "7": 7, 0057 "8": 8, 0058 "9": 9, 0059 ] 0060 0061 extension String { 0062 public var escapedJsonString
StringUtils.swift:71
    return source.escapedJsonString
: String { 0063 let mapped = characters 0064 .map { escapeMapping[$0] ?? String($0) } 0065 .joinWithSeparator("") 0066 return "\"" + mapped + "\"" 0067 } 0068 } 0069 0070 public func escapeAsJsonString
JsonSerializer.swift:27
            return escapeAsJsonString(s)
JsonSerializer.swift:55
                let escapedKey = escapeAsJsonString(key)
JsonSerializer.swift:101
                let escapedKey = escapeAsJsonString(key)
(source : String) -> String { 0071 return source.escapedJsonString 0072 } 0073 0074 func digitToInt
JsonParser.swift:183
            while let value = digitToInt(currentChar) where cur != end {
JsonParser.swift:196
            while let value = digitToInt(currentChar) where cur != end {
JsonParser.swift:221
            while let value = digitToInt(currentChar) where cur != end {
(b: UInt8) -> Int? { 0075 return digitMapping[UnicodeScalar(b)] 0076 } 0077 0078 func hexToDigit
JsonParser.swift:159
        while let d = hexToDigit(nextChar) {
(b: UInt8) -> UInt32? { 0079 return hexMapping[UnicodeScalar(b)] 0080 } 0081 0082