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
Parser.swift:33
extension Method {
Parser.swift:36
        case 00: self = DELETE
Parser.swift:37
        case 01: self = GET
Parser.swift:38
        case 02: self = HEAD
Parser.swift:39
        case 03: self = POST
Parser.swift:40
        case 04: self = PUT
Parser.swift:41
        case 05: self = CONNECT
Parser.swift:42
        case 06: self = OPTIONS
Parser.swift:43
        case 07: self = TRACE
Parser.swift:44
        case 08: self = COPY
Parser.swift:45
        case 09: self = LOCK
Parser.swift:46
        case 10: self = MKCOL
Parser.swift:47
        case 11: self = MOVE
Parser.swift:48
        case 12: self = PROPFIND
Parser.swift:49
        case 13: self = PROPPATCH
Parser.swift:50
        case 14: self = SEARCH
Parser.swift:51
        case 15: self = UNLOCK
Parser.swift:52
        case 16: self = BIND
Parser.swift:53
        case 17: self = REBIND
Parser.swift:54
        case 18: self = UNBIND
Parser.swift:55
        case 19: self = ACL
Parser.swift:56
        case 20: self = REPORT
Parser.swift:57
        case 21: self = MKACTIVITY
Parser.swift:58
        case 22: self = CHECKOUT
Parser.swift:59
        case 23: self = MERGE
Parser.swift:60
        case 24: self = MSEARCH
Parser.swift:61
        case 25: self = NOTIFY
Parser.swift:62
        case 26: self = SUBSCRIBE
Parser.swift:63
        case 27: self = UNSUBSCRIBE
Parser.swift:64
        case 28: self = PATCH
Parser.swift:65
        case 29: self = PURGE
Parser.swift:66
        case 30: self = MKCALENDAR
Parser.swift:67
        case 31: self = LINK
Parser.swift:68
        case 32: self = UNLINK
Parser.swift:69
        default: self = UNKNOWN
RequestParser.swift:33
    var method: Method! = nil
RequestParser.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: Method
Request.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) {
{ 0026 case DELETE
Parser.swift:36
        case 00: self = DELETE
Method.swift:71
        return [.GET, .POST, .PUT, .PATCH, .DELETE]
Method.swift:78
        case .DELETE:      return "DELETE"
0027 case GET
Parser.swift:37
        case 01: self = GET
Method.swift:71
        return [.GET, .POST, .PUT, .PATCH, .DELETE]
Method.swift:79
        case .GET:         return "GET"
0028 case HEAD
Parser.swift:38
        case 02: self = HEAD
Method.swift:80
        case .HEAD:        return "HEAD"
0029 case POST
Parser.swift:39
        case 03: self = POST
Method.swift:71
        return [.GET, .POST, .PUT, .PATCH, .DELETE]
Method.swift:81
        case .POST:        return "POST"
0030 case PUT
Parser.swift:40
        case 04: self = PUT
Method.swift:71
        return [.GET, .POST, .PUT, .PATCH, .DELETE]
Method.swift:82
        case .PUT:         return "PUT"
0031 case CONNECT
Parser.swift:41
        case 05: self = CONNECT
Method.swift:83
        case .CONNECT:     return "CONNECT"
0032 case OPTIONS
Parser.swift:42
        case 06: self = OPTIONS
Method.swift:84
        case .OPTIONS:     return "OPTIONS"
0033 case TRACE
Parser.swift:43
        case 07: self = TRACE
Method.swift:85
        case .TRACE:       return "TRACE"
0034 // WebDAV 0035 case COPY
Parser.swift:44
        case 08: self = COPY
Method.swift:86
        case .COPY:        return "COPY"
0036 case LOCK
Parser.swift:45
        case 09: self = LOCK
Method.swift:87
        case .LOCK:        return "LOCK"
0037 case MKCOL
Parser.swift:46
        case 10: self = MKCOL
Method.swift:88
        case .MKCOL:       return "MKCOL"
0038 case MOVE
Parser.swift:47
        case 11: self = MOVE
Method.swift:89
        case .MOVE:        return "MOVE"
0039 case PROPFIND
Parser.swift:48
        case 12: self = PROPFIND
Method.swift:90
        case .PROPFIND:    return "PROPFIND"
0040 case PROPPATCH
Parser.swift:49
        case 13: self = PROPPATCH
Method.swift:91
        case .PROPPATCH:   return "PROPPATCH"
0041 case SEARCH
Parser.swift:50
        case 14: self = SEARCH
Method.swift:92
        case .SEARCH:      return "SEARCH"
0042 case UNLOCK
Parser.swift:51
        case 15: self = UNLOCK
Method.swift:93
        case .UNLOCK:      return "UNLOCK"
0043 case BIND
Parser.swift:52
        case 16: self = BIND
Method.swift:94
        case .BIND:        return "BIND"
0044 case REBIND
Parser.swift:53
        case 17: self = REBIND
Method.swift:95
        case .REBIND:      return "REBIND"
0045 case UNBIND
Parser.swift:54
        case 18: self = UNBIND
Method.swift:96
        case .UNBIND:      return "UNBIND"
0046 case ACL
Parser.swift:55
        case 19: self = ACL
Method.swift:97
        case .ACL:         return "ACL"
0047 // Subversion 0048 case REPORT
Parser.swift:56
        case 20: self = REPORT
Method.swift:98
        case .REPORT:      return "REPORT"
0049 case MKACTIVITY
Parser.swift:57
        case 21: self = MKACTIVITY
Method.swift:99
        case .MKACTIVITY:  return "MKACTIVITY"
0050 case CHECKOUT
Parser.swift:58
        case 22: self = CHECKOUT
Method.swift:100
        case .CHECKOUT:    return "CHECKOUT"
0051 case MERGE
Parser.swift:59
        case 23: self = MERGE
Method.swift:101
        case .MERGE:       return "MERGE"
0052 // UPNP 0053 case MSEARCH
Parser.swift:60
        case 24: self = MSEARCH
Method.swift:102
        case .MSEARCH:     return "MSEARCH"
0054 case NOTIFY
Parser.swift:61
        case 25: self = NOTIFY
Method.swift:103
        case .NOTIFY:      return "NOTIFY"
0055 case SUBSCRIBE
Parser.swift:62
        case 26: self = SUBSCRIBE
Method.swift:104
        case .SUBSCRIBE:   return "SUBSCRIBE"
0056 case UNSUBSCRIBE
Parser.swift:63
        case 27: self = UNSUBSCRIBE
Method.swift:105
        case .UNSUBSCRIBE: return "UNSUBSCRIBE"
0057 // RFC-5789 0058 case PATCH
Parser.swift:64
        case 28: self = PATCH
Method.swift:71
        return [.GET, .POST, .PUT, .PATCH, .DELETE]
Method.swift:106
        case .PATCH:       return "PATCH"
0059 case PURGE
Parser.swift:65
        case 29: self = PURGE
Method.swift:107
        case .PURGE:       return "PURGE"
0060 // CalDAV 0061 case MKCALENDAR
Parser.swift:66
        case 30: self = MKCALENDAR
Method.swift:108
        case .MKCALENDAR:  return "MKCALENDAR"
0062 // RFC-2068, section 19.6.1.2 0063 case LINK
Parser.swift:67
        case 31: self = LINK
Method.swift:109
        case .LINK:        return "LINK"
0064 case UNLINK
Parser.swift:68
        case 32: self = UNLINK
Method.swift:110
        case .UNLINK:      return "UNLINK"
0065 0066 case UNKNOWN
Parser.swift:69
        default: self = UNKNOWN
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
Method.swift:118
        return description.hashValue
: 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 }