0001 0002 public protocol ByteType{ 0003 static var encodingType: EncodingType { get } 0004 static func fromString(string: String) -> [Self] 0005 } 0006 0007 extension UInt8: ByteType { 0008 public static var encodingType
Data.swift:8 extension UInt8: ByteType {: EncodingType { 0009 return .UTF8 0010 } 0011 0012 public static func fromString
Data.swift:43 encoding: UInt8.encodingType.encoding,(string: String) -> [UInt8] { 0013 let buf = [UInt8](string.utf8) 0014 return buf 0015 } 0016 } 0017 0018 enum EncodingError
Data.swift:36 self.bytes = UInt8.fromString(string): ErrorType { 0019 case Failed
Data.swift:45 throw EncodingError.Failed0020 } 0021 0022 public struct Data
Data.swift:45 throw EncodingError.Failed{ 0023 0024 public let bytes
Vaquita.swift:44 handler: (data: Data?, error: ErrorType?) -> ()) {Vaquita.swift:55 public class func readFileSync(path path: String) throws -> Data {Vaquita.swift:78 return Data(bytes: data)Vaquita.swift:81 public class func writeData(data: Data, toFilePath path: String,Vaquita.swift:93 public class func writeDataSync(data: Data, toFilePath path: String) throws {: [UInt8] 0025 0026 public var size
Data.swift:28 return self.bytes.count * sizeof(UInt8)Data.swift:32 self.bytes = bytesData.swift:36 self.bytes = UInt8.fromString(string)Data.swift:40 var bytes = self.bytes: Int { 0027 return self.bytes.count * sizeof(UInt8) 0028 } 0029 0030 public init
Vaquita.swift:99 fwrite(string, 1, data.size, fileptr)(bytes: [UInt8]) { 0031 self.bytes = bytes 0032 } 0033 0034 public init(string: String) { 0035 self.bytes = UInt8.fromString(string) 0036 } 0037 0038 public func toString
Vaquita.swift:78 return Data(bytes: data)() throws -> String { 0039 var bytes = self.bytes 0040 guard let str = String(bytesNoCopy: &bytes, 0041 length: bytes.count * sizeof(UInt8), 0042 encoding: UInt8.encodingType.encoding, 0043 freeWhenDone: false) else { 0044 throw EncodingError.Failed 0045 } 0046 0047 return str 0048 } 0049 } 0050
Vaquita.swift:98 let string = try data.toString()