Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:03:52

0001 //
0002 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // Official repository: https://github.com/boostorg/beast
0008 //
0009 
0010 #ifndef BOOST_BEAST_HTTP_STATUS_HPP
0011 #define BOOST_BEAST_HTTP_STATUS_HPP
0012 
0013 #include <boost/beast/core/detail/config.hpp>
0014 #include <boost/beast/core/string.hpp>
0015 #include <iosfwd>
0016 
0017 namespace boost {
0018 namespace beast {
0019 namespace http {
0020 
0021 enum class status : unsigned
0022 {
0023     /** An unknown status-code.
0024 
0025         This value indicates that the value for the status code
0026         is not in the list of commonly recognized status codes.
0027         Callers interested in the exactly value should use the
0028         interface which provides the raw integer.
0029     */
0030     unknown = 0,
0031 
0032     continue_                           = 100,
0033 
0034     /** Switching Protocols
0035 
0036         This status indicates that a request to switch to a new
0037         protocol was accepted and applied by the server. A successful
0038         response to a WebSocket Upgrade HTTP request will have this
0039         code.
0040     */
0041     switching_protocols                 = 101,
0042 
0043     processing                          = 102,
0044 
0045     ok                                  = 200,
0046     created                             = 201,
0047     accepted                            = 202,
0048     non_authoritative_information       = 203,
0049     no_content                          = 204,
0050     reset_content                       = 205,
0051     partial_content                     = 206,
0052     multi_status                        = 207,
0053     already_reported                    = 208,
0054     im_used                             = 226,
0055 
0056     multiple_choices                    = 300,
0057     moved_permanently                   = 301,
0058     found                               = 302,
0059     see_other                           = 303,
0060     not_modified                        = 304,
0061     use_proxy                           = 305,
0062     temporary_redirect                  = 307,
0063     permanent_redirect                  = 308,
0064 
0065     bad_request                         = 400,
0066     unauthorized                        = 401,
0067     payment_required                    = 402,
0068     forbidden                           = 403,
0069     not_found                           = 404,
0070     method_not_allowed                  = 405,
0071     not_acceptable                      = 406,
0072     proxy_authentication_required       = 407,
0073     request_timeout                     = 408,
0074     conflict                            = 409,
0075     gone                                = 410,
0076     length_required                     = 411,
0077     precondition_failed                 = 412,
0078     payload_too_large                   = 413,
0079     uri_too_long                        = 414,
0080     unsupported_media_type              = 415,
0081     range_not_satisfiable               = 416,
0082     expectation_failed                  = 417,
0083     misdirected_request                 = 421,
0084     unprocessable_entity                = 422,
0085     locked                              = 423,
0086     failed_dependency                   = 424,
0087     upgrade_required                    = 426,
0088     precondition_required               = 428,
0089     too_many_requests                   = 429,
0090     request_header_fields_too_large     = 431,
0091     connection_closed_without_response  = 444,
0092     unavailable_for_legal_reasons       = 451,
0093     client_closed_request               = 499,
0094 
0095     internal_server_error               = 500,
0096     not_implemented                     = 501,
0097     bad_gateway                         = 502,
0098     service_unavailable                 = 503,
0099     gateway_timeout                     = 504,
0100     http_version_not_supported          = 505,
0101     variant_also_negotiates             = 506,
0102     insufficient_storage                = 507,
0103     loop_detected                       = 508,
0104     not_extended                        = 510,
0105     network_authentication_required     = 511,
0106     network_connect_timeout_error       = 599
0107 };
0108 
0109 /** Represents the class of a status-code.
0110 */
0111 enum class status_class : unsigned
0112 {
0113     /// Unknown status-class
0114     unknown = 0,
0115 
0116     /// The request was received, continuing processing.
0117     informational = 1,
0118 
0119     /// The request was successfully received, understood, and accepted.
0120     successful = 2,
0121 
0122     /// Further action needs to be taken in order to complete the request.
0123     redirection = 3,
0124 
0125     /// The request contains bad syntax or cannot be fulfilled.
0126     client_error = 4,
0127 
0128     /// The server failed to fulfill an apparently valid request.
0129     server_error = 5,
0130 };
0131 
0132 /** Converts the integer to a known status-code.
0133 
0134     If the integer does not match a known status code,
0135     @ref status::unknown is returned.
0136 */
0137 BOOST_BEAST_DECL
0138 status
0139 int_to_status(unsigned v);
0140 
0141 /** Convert an integer to a status_class.
0142 
0143     @param v The integer representing a status code.
0144 
0145     @return The status class. If the integer does not match
0146     a known status class, @ref status_class::unknown is returned.
0147 */
0148 BOOST_BEAST_DECL
0149 status_class
0150 to_status_class(unsigned v);
0151 
0152 /** Convert a status_code to a status_class.
0153 
0154     @param v The status code to convert.
0155 
0156     @return The status class.
0157 */
0158 BOOST_BEAST_DECL
0159 status_class
0160 to_status_class(status v);
0161 
0162 /** Returns the obsolete reason-phrase text for a status code.
0163 
0164     @param v The status code to use.
0165 */
0166 BOOST_BEAST_DECL
0167 string_view
0168 obsolete_reason(status v);
0169 
0170 /// Outputs the standard reason phrase of a status code to a stream.
0171 BOOST_BEAST_DECL
0172 std::ostream&
0173 operator<<(std::ostream&, status);
0174 
0175 } // http
0176 } // beast
0177 } // boost
0178 
0179 #ifdef BOOST_BEAST_HEADER_ONLY
0180 #include <boost/beast/http/impl/status.ipp>
0181 #endif
0182 
0183 #endif