/usr/include/ace/INet/HTTP_Status.h is in libace-inet-dev 6.0.3+dfsg-0.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | // $Id: HTTP_Status.h 90737 2010-06-21 09:46:14Z mcorino $
/**
* @file HTTP_Status.h
*
* @author Martin Corino <mcorino@remedy.nl>
*/
#ifndef ACE_HTTP_STATUS_H
#define ACE_HTTP_STATUS_H
#include /**/ "ace/pre.h"
#include /**/ "ace/config-all.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "ace/SString.h"
#include "ace/INet/INet_Export.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
namespace ACE
{
namespace HTTP
{
/**
* @class ACE_HTTP_Status
*
* @brief Encapsulates HTTP status codes and reasons.
*
*/
class ACE_INET_Export Status
{
public:
enum Code
{
INVALID = -1,
HTTP_NONE = 0,
HTTP_CONTINUE = 100,
HTTP_SWITCHING_PROTOCOLS = 101,
HTTP_OK = 200,
HTTP_CREATED = 201,
HTTP_ACCEPTED = 202,
HTTP_NONAUTHORITATIVE = 203,
HTTP_NO_CONTENT = 204,
HTTP_RESET_CONTENT = 205,
HTTP_PARTIAL_CONTENT = 206,
HTTP_MULTIPLE_CHOICES = 300,
HTTP_MOVED_PERMANENTLY = 301,
HTTP_FOUND = 302,
HTTP_SEE_OTHER = 303,
HTTP_NOT_MODIFIED = 304,
HTTP_USEPROXY = 305,
// 306 not defined
HTTP_TEMPORARY_REDIRECT = 307,
HTTP_BAD_REQUEST = 400,
HTTP_UNAUTHORIZED = 401,
HTTP_PAYMENT_REQUIRED = 402,
HTTP_FORBIDDEN = 403,
HTTP_NOT_FOUND = 404,
HTTP_METHOD_NOT_ALLOWED = 405,
HTTP_NOT_ACCEPTABLE = 406,
HTTP_PROXY_AUTHENTICATION_REQUIRED = 407,
HTTP_REQUEST_TIMEOUT = 408,
HTTP_CONFLICT = 409,
HTTP_GONE = 410,
HTTP_LENGTH_REQUIRED = 411,
HTTP_PRECONDITION_FAILED = 412,
HTTP_REQUESTENTITYTOOLARGE = 413,
HTTP_REQUESTURITOOLONG = 414,
HTTP_UNSUPPORTEDMEDIATYPE = 415,
HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416,
HTTP_EXPECTATION_FAILED = 417,
HTTP_INTERNAL_SERVER_ERROR = 500,
HTTP_NOT_IMPLEMENTED = 501,
HTTP_BAD_GATEWAY = 502,
HTTP_SERVICE_UNAVAILABLE = 503,
HTTP_GATEWAY_TIMEOUT = 504,
HTTP_VERSION_NOT_SUPPORTED = 505
};
/// Constructor; sets value to OK
Status();
/// Constructor; sets corresponding reason
Status(Code status);
/// Constructor
Status(Code status, const ACE_CString& reason);
/// Copy constructor
Status(const Status& status);
/// Copy assignment
Status& operator =(const Status& status);
/// Set the status code.
void set_status(Code status);
/// Set the status code.
/// String must contain valid numeric code.
void set_status(const ACE_CString& status);
/// Return the status code.
Code get_status() const;
/// Set the reason phrase.
void set_reason(const ACE_CString& reason);
/// Return the reason phrase.
const ACE_CString& get_reason() const;
/// Set the status code and corresponding reason phrase.
void set_status_and_reason(Code status);
/// Return true if status code != INVALID
bool is_valid () const;
/// Return true if status code == OK
bool is_ok () const;
/// Return true in case of a *valid* HTTP status
operator bool () const;
/// Return true if status code == INVALID
bool operator !() const;
/// Returns an appropriate reason phrase
static const ACE_CString& get_reason(Code status);
static const ACE_CString HTTP_REASON_CONTINUE;
static const ACE_CString HTTP_REASON_SWITCHING_PROTOCOLS;
static const ACE_CString HTTP_REASON_OK;
static const ACE_CString HTTP_REASON_CREATED;
static const ACE_CString HTTP_REASON_ACCEPTED;
static const ACE_CString HTTP_REASON_NONAUTHORITATIVE;
static const ACE_CString HTTP_REASON_NO_CONTENT;
static const ACE_CString HTTP_REASON_RESET_CONTENT;
static const ACE_CString HTTP_REASON_PARTIAL_CONTENT;
static const ACE_CString HTTP_REASON_MULTIPLE_CHOICES;
static const ACE_CString HTTP_REASON_MOVED_PERMANENTLY;
static const ACE_CString HTTP_REASON_FOUND;
static const ACE_CString HTTP_REASON_SEE_OTHER;
static const ACE_CString HTTP_REASON_NOT_MODIFIED;
static const ACE_CString HTTP_REASON_USEPROXY;
static const ACE_CString HTTP_REASON_TEMPORARY_REDIRECT;
static const ACE_CString HTTP_REASON_BAD_REQUEST;
static const ACE_CString HTTP_REASON_UNAUTHORIZED;
static const ACE_CString HTTP_REASON_PAYMENT_REQUIRED;
static const ACE_CString HTTP_REASON_FORBIDDEN;
static const ACE_CString HTTP_REASON_NOT_FOUND;
static const ACE_CString HTTP_REASON_METHOD_NOT_ALLOWED;
static const ACE_CString HTTP_REASON_NOT_ACCEPTABLE;
static const ACE_CString HTTP_REASON_PROXY_AUTHENTICATION_REQUIRED;
static const ACE_CString HTTP_REASON_REQUEST_TIMEOUT;
static const ACE_CString HTTP_REASON_CONFLICT;
static const ACE_CString HTTP_REASON_GONE;
static const ACE_CString HTTP_REASON_LENGTH_REQUIRED;
static const ACE_CString HTTP_REASON_PRECONDITION_FAILED;
static const ACE_CString HTTP_REASON_REQUESTENTITYTOOLARGE;
static const ACE_CString HTTP_REASON_REQUESTURITOOLONG;
static const ACE_CString HTTP_REASON_UNSUPPORTEDMEDIATYPE;
static const ACE_CString HTTP_REASON_REQUESTED_RANGE_NOT_SATISFIABLE;
static const ACE_CString HTTP_REASON_EXPECTATION_FAILED;
static const ACE_CString HTTP_REASON_INTERNAL_SERVER_ERROR;
static const ACE_CString HTTP_REASON_NOT_IMPLEMENTED;
static const ACE_CString HTTP_REASON_BAD_GATEWAY;
static const ACE_CString HTTP_REASON_SERVICE_UNAVAILABLE;
static const ACE_CString HTTP_REASON_GATEWAY_TIMEOUT;
static const ACE_CString HTTP_REASON_VERSION_NOT_SUPPORTED;
static const ACE_CString HTTP_REASON_UNKNOWN;
private:
Code code_;
ACE_CString reason_;
};
}
}
ACE_END_VERSIONED_NAMESPACE_DECL
#if defined (__ACE_INLINE__)
#include "ace/INet/HTTP_Status.inl"
#endif
#include /**/ "ace/post.h"
#endif /* ACE_HTTP_STATUS_H */
|