AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
status.hpp
1/*
2 ANCH Framework: ANother C++ Hack is a C++ framework based on C++23 standard
3 Copyright (C) 2026 Vincent Lachenal
4
5 This file is part of ANCH Framework.
6
7 ANCH Framework is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 ANCH Framework is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with ANCH Framework. If not, see <https://www.gnu.org/licenses/>.
19*/
20#pragma once
21
22#include "anch-rest-common-export.hpp"
23
24#include <cstdint>
25#include <string_view>
26
27namespace anch::rest {
28
36 enum class Status: uint16_t {
37 CONTINUE = 100,
38 SWITCHING_PROTOCOLS = 101,
39 PROCESSING = 102,
40 EARLY_HINTS = 103,
41 OK = 200,
42 CREATED = 201,
43 ACCEPTED = 202,
44 NON_AUTHORITATIVE_INFORMATION = 203,
45 NO_CONTENT = 204,
46 RESET_CONTENT = 205,
47 PARTIAL_CONTENT = 206,
48 MULTI_STATUS = 207,
49 ALREADY_REPORTED = 208,
50 IM_USED = 226,
51 MULTIPLE_CHOICES = 300,
52 MOVED_PERMANENTLY = 301,
53 FOUND = 302,
54 SEE_OTHER = 303,
55 NOT_MODIFIED = 304,
56 TEMPORARY_REDIRECT = 307,
57 PERMANENT_REDIRECT = 308,
58 BAD_REQUEST = 400,
59 UNAUTHORIZED = 401,
60 PAYMENT_REQUIRED = 402,
61 FORBIDDEN = 403,
62 NOT_FOUND = 404,
63 METHOD_NOT_ALLOWED = 405,
64 NOT_ACCEPTABLE = 406,
65 PROXY_AUTHENTICATION_REQUIRED = 407,
66 REQUEST_TIMEOUT = 408,
67 CONFLICT = 409,
68 GONE = 410,
69 LENGTH_REQUIRED = 411,
70 PRECONDITION_FAILED = 412,
71 CONTENT_TOO_LARGE = 413,
72 URI_TOO_LONG = 414,
73 UNSUPPORTED_MEDIA_TYPE = 415,
74 RANGE_NOT_SATISFIABLE = 416,
75 EXPECTATION_FAILED = 417,
76 IM_A_TEAPOT = 418,
77 MISDIRECTED_REQUEST = 421,
78 UNPROCESSABLE_CONTENT = 422,
79 LOCKED = 423,
80 FAILED_DEPENDENCY = 424,
81 TOO_EARLY = 425,
82 UPGRADE_REQUIRED = 426,
83 PRECONDITION_REQUIRED = 428,
84 TOO_MANY_REQUESTS = 429,
85 REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
86 UNAVAILABLE_FOR_LEGAL_REASONS = 451,
87 INTERNAL_SERVER_ERROR = 500,
88 NOT_IMPLEMENTED = 501,
89 BAD_GATEWAY = 502,
90 SERVICE_UNAVAILABLE = 503,
91 GATEWAY_TIMEOUT = 504,
92 HTTP_VERSION_NOT_SUPPORTED = 505,
93 VARIANT_ALSO_NEGOTIATES = 506,
94 INSUFFICIENT_STORAGE = 507,
95 LOOP_DETECTED = 508,
96 NETWORK_AUTHENTICATION_REQUIRED = 511
97 };
98
106 constexpr uint16_t
107 code(anch::rest::Status status) noexcept {
108 return static_cast<uint16_t>(status);
109 }
110
118 ANCH_REST_COMMON_EXPORT std::string_view reasonPhrase(anch::rest::Status status) noexcept;
119
120}
AnCH REST library namespace.
Definition auth.hpp:29
std::string_view reasonPhrase(anch::rest::Status status) noexcept
Status
Definition status.hpp:36
constexpr uint16_t code(anch::rest::Status status) noexcept
Definition status.hpp:107