0001 // Method.swift 0002 // 0003 // The MIT License (MIT) 0004 // 0005 // Copyright (c) 2015 Zewo 0006 // 0007 // Permission is hereby granted, free of charge, to any person obtaining a copy 0008 // of this software and associated documentation files (the "Software"), to deal 0009 // in the Software without restriction, including without limitation the rights 0010 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 0011 // copies of the Software, and to permit persons to whom the Software is 0012 // furnished to do so, subject to the following conditions: 0013 // 0014 // The above copyright notice and this permission notice shall be included in all 0015 // copies or substantial portions of the Software. 0016 // 0017 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 0018 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 0019 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 0020 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 0021 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 0022 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 0023 // SOFTWARE. 0024 0025 public enum Method{ 0026 case DELETE
Parser.swift:33 extension Method {Parser.swift:36 case 00: self = DELETEParser.swift:37 case 01: self = GETParser.swift:38 case 02: self = HEADParser.swift:39 case 03: self = POSTParser.swift:40 case 04: self = PUTParser.swift:41 case 05: self = CONNECTParser.swift:42 case 06: self = OPTIONSParser.swift:43 case 07: self = TRACEParser.swift:44 case 08: self = COPYParser.swift:45 case 09: self = LOCKParser.swift:46 case 10: self = MKCOLParser.swift:47 case 11: self = MOVEParser.swift:48 case 12: self = PROPFINDParser.swift:49 case 13: self = PROPPATCHParser.swift:50 case 14: self = SEARCHParser.swift:51 case 15: self = UNLOCKParser.swift:52 case 16: self = BINDParser.swift:53 case 17: self = REBINDParser.swift:54 case 18: self = UNBINDParser.swift:55 case 19: self = ACLParser.swift:56 case 20: self = REPORTParser.swift:57 case 21: self = MKACTIVITYParser.swift:58 case 22: self = CHECKOUTParser.swift:59 case 23: self = MERGEParser.swift:60 case 24: self = MSEARCHParser.swift:61 case 25: self = NOTIFYParser.swift:62 case 26: self = SUBSCRIBEParser.swift:63 case 27: self = UNSUBSCRIBEParser.swift:64 case 28: self = PATCHParser.swift:65 case 29: self = PURGEParser.swift:66 case 30: self = MKCALENDARParser.swift:67 case 31: self = LINKParser.swift:68 case 32: self = UNLINKParser.swift:69 default: self = UNKNOWNRequestParser.swift:33 var method: Method! = nilRequestParser.swift:173 $0.method = Method(code: Int(parser.memory.method))Method.swift:69 extension Method {Method.swift:70 public static var commonMethods: Set<Method> {Method.swift:75 extension Method: CustomStringConvertible {Method.swift:116 extension Method: Hashable {Request.swift:32 public var method: MethodRequest.swift:42 init(method: Method, uri: URI, version: Version, headers: Headers, cookies: Cookies, body: Body, upgrade: Upgrade?) {Request.swift:54 public init(method: Method, uri: URI, headers: Headers = [:], cookies: Cookies = [], body: Body, upgrade: Upgrade? = nil) {Request.swift:72 public init(method: Method, uri: URI, headers: Headers = [:], cookies: Cookies = [], body: Data = nil, upgrade: Upgrade? = nil) {Request.swift:83 public init(method: Method, uri: URI, headers: Headers = [:], cookies: Cookies = [], body: DataConvertible, upgrade: Upgrade? = nil) {Request.swift:94 public init(method: Method, uri: URI, headers: Headers = [:], cookies: Cookies = [], body: StreamType, upgrade: Upgrade? = nil) {Request.swift:105 public init(method: Method, uri: String, headers: Headers = [:], cookies: Cookies = [], body: Data = nil, upgrade: Upgrade? = nil) throws {Request.swift:116 public init(method: Method, uri: String, headers: Headers = [:], cookies: Cookies = [], body: DataConvertible, upgrade: Upgrade? = nil) throws {Request.swift:127 public init(method: Method, uri: String, headers: Headers = [:], cookies: Cookies = [], body: StreamType, upgrade: Upgrade? = nil) throws {Route.swift:26 public let methods: Set<Method>Route.swift:31 public init(methods: Set<Method>, path: String, middleware: [MiddlewareType], responder: ResponderType) {0027 case GET
Parser.swift:36 case 00: self = DELETEMethod.swift:71 return [.GET, .POST, .PUT, .PATCH, .DELETE]Method.swift:78 case .DELETE: return "DELETE"0028 case HEAD
Parser.swift:37 case 01: self = GETMethod.swift:71 return [.GET, .POST, .PUT, .PATCH, .DELETE]Method.swift:79 case .GET: return "GET"0029 case POST
Parser.swift:38 case 02: self = HEADMethod.swift:80 case .HEAD: return "HEAD"0030 case PUT
Parser.swift:39 case 03: self = POSTMethod.swift:71 return [.GET, .POST, .PUT, .PATCH, .DELETE]Method.swift:81 case .POST: return "POST"0031 case CONNECT
Parser.swift:40 case 04: self = PUTMethod.swift:71 return [.GET, .POST, .PUT, .PATCH, .DELETE]Method.swift:82 case .PUT: return "PUT"0032 case OPTIONS
Parser.swift:41 case 05: self = CONNECTMethod.swift:83 case .CONNECT: return "CONNECT"0033 case TRACE
Parser.swift:42 case 06: self = OPTIONSMethod.swift:84 case .OPTIONS: return "OPTIONS"0034 // WebDAV 0035 case COPY
Parser.swift:43 case 07: self = TRACEMethod.swift:85 case .TRACE: return "TRACE"0036 case LOCK
Parser.swift:44 case 08: self = COPYMethod.swift:86 case .COPY: return "COPY"0037 case MKCOL
Parser.swift:45 case 09: self = LOCKMethod.swift:87 case .LOCK: return "LOCK"0038 case MOVE
Parser.swift:46 case 10: self = MKCOLMethod.swift:88 case .MKCOL: return "MKCOL"0039 case PROPFIND
Parser.swift:47 case 11: self = MOVEMethod.swift:89 case .MOVE: return "MOVE"0040 case PROPPATCH
Parser.swift:48 case 12: self = PROPFINDMethod.swift:90 case .PROPFIND: return "PROPFIND"0041 case SEARCH
Parser.swift:49 case 13: self = PROPPATCHMethod.swift:91 case .PROPPATCH: return "PROPPATCH"0042 case UNLOCK
Parser.swift:50 case 14: self = SEARCHMethod.swift:92 case .SEARCH: return "SEARCH"0043 case BIND
Parser.swift:51 case 15: self = UNLOCKMethod.swift:93 case .UNLOCK: return "UNLOCK"0044 case REBIND
Parser.swift:52 case 16: self = BINDMethod.swift:94 case .BIND: return "BIND"0045 case UNBIND
Parser.swift:53 case 17: self = REBINDMethod.swift:95 case .REBIND: return "REBIND"0046 case ACL
Parser.swift:54 case 18: self = UNBINDMethod.swift:96 case .UNBIND: return "UNBIND"0047 // Subversion 0048 case REPORT
Parser.swift:55 case 19: self = ACLMethod.swift:97 case .ACL: return "ACL"0049 case MKACTIVITY
Parser.swift:56 case 20: self = REPORTMethod.swift:98 case .REPORT: return "REPORT"0050 case CHECKOUT
Parser.swift:57 case 21: self = MKACTIVITYMethod.swift:99 case .MKACTIVITY: return "MKACTIVITY"0051 case MERGE
Parser.swift:58 case 22: self = CHECKOUTMethod.swift:100 case .CHECKOUT: return "CHECKOUT"0052 // UPNP 0053 case MSEARCH
Parser.swift:59 case 23: self = MERGEMethod.swift:101 case .MERGE: return "MERGE"0054 case NOTIFY
Parser.swift:60 case 24: self = MSEARCHMethod.swift:102 case .MSEARCH: return "MSEARCH"0055 case SUBSCRIBE
Parser.swift:61 case 25: self = NOTIFYMethod.swift:103 case .NOTIFY: return "NOTIFY"0056 case UNSUBSCRIBE
Parser.swift:62 case 26: self = SUBSCRIBEMethod.swift:104 case .SUBSCRIBE: return "SUBSCRIBE"0057 // RFC-5789 0058 case PATCH
Parser.swift:63 case 27: self = UNSUBSCRIBEMethod.swift:105 case .UNSUBSCRIBE: return "UNSUBSCRIBE"0059 case PURGE
Parser.swift:64 case 28: self = PATCHMethod.swift:71 return [.GET, .POST, .PUT, .PATCH, .DELETE]Method.swift:106 case .PATCH: return "PATCH"0060 // CalDAV 0061 case MKCALENDAR
Parser.swift:65 case 29: self = PURGEMethod.swift:107 case .PURGE: return "PURGE"0062 // RFC-2068, section 19.6.1.2 0063 case LINK
Parser.swift:66 case 30: self = MKCALENDARMethod.swift:108 case .MKCALENDAR: return "MKCALENDAR"0064 case UNLINK
Parser.swift:67 case 31: self = LINKMethod.swift:109 case .LINK: return "LINK"0065 0066 case UNKNOWN
Parser.swift:68 case 32: self = UNLINKMethod.swift:110 case .UNLINK: return "UNLINK"0067 } 0068 0069 extension Method { 0070 public static var commonMethods: Set<Method> { 0071 return [.GET, .POST, .PUT, .PATCH, .DELETE] 0072 } 0073 } 0074 0075 extension Method: CustomStringConvertible { 0076 public var description
Parser.swift:69 default: self = UNKNOWN: String { 0077 switch self { 0078 case .DELETE: return "DELETE" 0079 case .GET: return "GET" 0080 case .HEAD: return "HEAD" 0081 case .POST: return "POST" 0082 case .PUT: return "PUT" 0083 case .CONNECT: return "CONNECT" 0084 case .OPTIONS: return "OPTIONS" 0085 case .TRACE: return "TRACE" 0086 case .COPY: return "COPY" 0087 case .LOCK: return "LOCK" 0088 case .MKCOL: return "MKCOL" 0089 case .MOVE: return "MOVE" 0090 case .PROPFIND: return "PROPFIND" 0091 case .PROPPATCH: return "PROPPATCH" 0092 case .SEARCH: return "SEARCH" 0093 case .UNLOCK: return "UNLOCK" 0094 case .BIND: return "BIND" 0095 case .REBIND: return "REBIND" 0096 case .UNBIND: return "UNBIND" 0097 case .ACL: return "ACL" 0098 case .REPORT: return "REPORT" 0099 case .MKACTIVITY: return "MKACTIVITY" 0100 case .CHECKOUT: return "CHECKOUT" 0101 case .MERGE: return "MERGE" 0102 case .MSEARCH: return "MSEARCH" 0103 case .NOTIFY: return "NOTIFY" 0104 case .SUBSCRIBE: return "SUBSCRIBE" 0105 case .UNSUBSCRIBE: return "UNSUBSCRIBE" 0106 case .PATCH: return "PATCH" 0107 case .PURGE: return "PURGE" 0108 case .MKCALENDAR: return "MKCALENDAR" 0109 case .LINK: return "LINK" 0110 case .UNLINK: return "UNLINK" 0111 default: return "UNKNOWN" 0112 } 0113 } 0114 } 0115 0116 extension Method: Hashable { 0117 public var hashValue: Int { 0118 return description.hashValue 0119 } 0120 }
Method.swift:118 return description.hashValue