1 //
2 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // Official repository: https://github.com/boostorg/beast
8 //
9 
10 #ifndef BOOST_BEAST_HTTP_FIELD_HPP
11 #define BOOST_BEAST_HTTP_FIELD_HPP
12 
13 #include <boost/beast/core/detail/config.hpp>
14 #include <boost/beast/core/string.hpp>
15 #include <iosfwd>
16 
17 namespace boost {
18 namespace beast {
19 namespace http {
20 
21     enum class field : unsigned short
22     {
23         unknown = 0,
24 
25         a_im,
26         accept,
27         accept_additions,
28         accept_charset,
29         accept_datetime,
30         accept_encoding,
31         accept_features,
32         accept_language,
33         accept_patch,
34         accept_post,
35         accept_ranges,
36         access_control,
37         access_control_allow_credentials,
38         access_control_allow_headers,
39         access_control_allow_methods,
40         access_control_allow_origin,
41         access_control_expose_headers,
42         access_control_max_age,
43         access_control_request_headers,
44         access_control_request_method,
45         age,
46         allow,
47         alpn,
48         also_control,
49         alt_svc,
50         alt_used,
51         alternate_recipient,
52         alternates,
53         apparently_to,
54         apply_to_redirect_ref,
55         approved,
56         archive,
57         archived_at,
58         article_names,
59         article_updates,
60         authentication_control,
61         authentication_info,
62         authentication_results,
63         authorization,
64         auto_submitted,
65         autoforwarded,
66         autosubmitted,
67         base,
68         bcc,
69         body,
70         c_ext,
71         c_man,
72         c_opt,
73         c_pep,
74         c_pep_info,
75         cache_control,
76         caldav_timezones,
77         cancel_key,
78         cancel_lock,
79         cc,
80         close,
81         comments,
82         compliance,
83         connection,
84         content_alternative,
85         content_base,
86         content_description,
87         content_disposition,
88         content_duration,
89         content_encoding,
90         content_features,
91         content_id,
92         content_identifier,
93         content_language,
94         content_length,
95         content_location,
96         content_md5,
97         content_range,
98         content_return,
99         content_script_type,
100         content_style_type,
101         content_transfer_encoding,
102         content_type,
103         content_version,
104         control,
105         conversion,
106         conversion_with_loss,
107         cookie,
108         cookie2,
109         cost,
110         dasl,
111         date,
112         date_received,
113         dav,
114         default_style,
115         deferred_delivery,
116         delivery_date,
117         delta_base,
118         depth,
119         derived_from,
120         destination,
121         differential_id,
122         digest,
123         discarded_x400_ipms_extensions,
124         discarded_x400_mts_extensions,
125         disclose_recipients,
126         disposition_notification_options,
127         disposition_notification_to,
128         distribution,
129         dkim_signature,
130         dl_expansion_history,
131         downgraded_bcc,
132         downgraded_cc,
133         downgraded_disposition_notification_to,
134         downgraded_final_recipient,
135         downgraded_from,
136         downgraded_in_reply_to,
137         downgraded_mail_from,
138         downgraded_message_id,
139         downgraded_original_recipient,
140         downgraded_rcpt_to,
141         downgraded_references,
142         downgraded_reply_to,
143         downgraded_resent_bcc,
144         downgraded_resent_cc,
145         downgraded_resent_from,
146         downgraded_resent_reply_to,
147         downgraded_resent_sender,
148         downgraded_resent_to,
149         downgraded_return_path,
150         downgraded_sender,
151         downgraded_to,
152         ediint_features,
153         eesst_version,
154         encoding,
155         encrypted,
156         errors_to,
157         etag,
158         expect,
159         expires,
160         expiry_date,
161         ext,
162         followup_to,
163         forwarded,
164         from,
165         generate_delivery_report,
166         getprofile,
167         hobareg,
168         host,
169         http2_settings,
170         if_,
171         if_match,
172         if_modified_since,
173         if_none_match,
174         if_range,
175         if_schedule_tag_match,
176         if_unmodified_since,
177         im,
178         importance,
179         in_reply_to,
180         incomplete_copy,
181         injection_date,
182         injection_info,
183         jabber_id,
184         keep_alive,
185         keywords,
186         label,
187         language,
188         last_modified,
189         latest_delivery_time,
190         lines,
191         link,
192         list_archive,
193         list_help,
194         list_id,
195         list_owner,
196         list_post,
197         list_subscribe,
198         list_unsubscribe,
199         list_unsubscribe_post,
200         location,
201         lock_token,
202         man,
203         max_forwards,
204         memento_datetime,
205         message_context,
206         message_id,
207         message_type,
208         meter,
209         method_check,
210         method_check_expires,
211         mime_version,
212         mmhs_acp127_message_identifier,
213         mmhs_authorizing_users,
214         mmhs_codress_message_indicator,
215         mmhs_copy_precedence,
216         mmhs_exempted_address,
217         mmhs_extended_authorisation_info,
218         mmhs_handling_instructions,
219         mmhs_message_instructions,
220         mmhs_message_type,
221         mmhs_originator_plad,
222         mmhs_originator_reference,
223         mmhs_other_recipients_indicator_cc,
224         mmhs_other_recipients_indicator_to,
225         mmhs_primary_precedence,
226         mmhs_subject_indicator_codes,
227         mt_priority,
228         negotiate,
229         newsgroups,
230         nntp_posting_date,
231         nntp_posting_host,
232         non_compliance,
233         obsoletes,
234         opt,
235         optional,
236         optional_www_authenticate,
237         ordering_type,
238         organization,
239         origin,
240         original_encoded_information_types,
241         original_from,
242         original_message_id,
243         original_recipient,
244         original_sender,
245         original_subject,
246         originator_return_address,
247         overwrite,
248         p3p,
249         path,
250         pep,
251         pep_info,
252         pics_label,
253         position,
254         posting_version,
255         pragma,
256         prefer,
257         preference_applied,
258         prevent_nondelivery_report,
259         priority,
260         privicon,
261         profileobject,
262         protocol,
263         protocol_info,
264         protocol_query,
265         protocol_request,
266         proxy_authenticate,
267         proxy_authentication_info,
268         proxy_authorization,
269         proxy_connection,
270         proxy_features,
271         proxy_instruction,
272         public_,
273         public_key_pins,
274         public_key_pins_report_only,
275         range,
276         received,
277         received_spf,
278         redirect_ref,
279         references,
280         referer,
281         referer_root,
282         relay_version,
283         reply_by,
284         reply_to,
285         require_recipient_valid_since,
286         resent_bcc,
287         resent_cc,
288         resent_date,
289         resent_from,
290         resent_message_id,
291         resent_reply_to,
292         resent_sender,
293         resent_to,
294         resolution_hint,
295         resolver_location,
296         retry_after,
297         return_path,
298         safe,
299         schedule_reply,
300         schedule_tag,
301         sec_fetch_dest,
302         sec_fetch_mode,
303         sec_fetch_site,
304         sec_fetch_user,
305         sec_websocket_accept,
306         sec_websocket_extensions,
307         sec_websocket_key,
308         sec_websocket_protocol,
309         sec_websocket_version,
310         security_scheme,
311         see_also,
312         sender,
313         sensitivity,
314         server,
315         set_cookie,
316         set_cookie2,
317         setprofile,
318         sio_label,
319         sio_label_history,
320         slug,
321         soapaction,
322         solicitation,
323         status_uri,
324         strict_transport_security,
325         subject,
326         subok,
327         subst,
328         summary,
329         supersedes,
330         surrogate_capability,
331         surrogate_control,
332         tcn,
333         te,
334         timeout,
335         title,
336         to,
337         topic,
338         trailer,
339         transfer_encoding,
340         ttl,
341         ua_color,
342         ua_media,
343         ua_pixels,
344         ua_resolution,
345         ua_windowpixels,
346         upgrade,
347         urgency,
348         uri,
349         user_agent,
350         variant_vary,
351         vary,
352         vbr_info,
353         version,
354         via,
355         want_digest,
356         warning,
357         www_authenticate,
358         x_archived_at,
359         x_device_accept,
360         x_device_accept_charset,
361         x_device_accept_encoding,
362         x_device_accept_language,
363         x_device_user_agent,
364         x_frame_options,
365         x_mittente,
366         x_pgp_sig,
367         x_ricevuta,
368         x_riferimento_message_id,
369         x_tiporicevuta,
370         x_trasporto,
371         x_verificasicurezza,
372         x400_content_identifier,
373         x400_content_return,
374         x400_content_type,
375         x400_mts_identifier,
376         x400_originator,
377         x400_received,
378         x400_recipients,
379         x400_trace,
380         xref
381     };
382 /** Convert a field enum to a string.
383 
384     @param f The field to convert
385 */
386 BOOST_BEAST_DECL
387 string_view
388 to_string(field f);
389 
390 /** Attempt to convert a string to a field enum.
391 
392     The string comparison is case-insensitive.
393 
394     @return The corresponding field, or @ref field::unknown
395     if no known field matches.
396 */
397 BOOST_BEAST_DECL
398 field
399 string_to_field(string_view s);
400 
401 /// Write the text for a field name to an output stream.
402 BOOST_BEAST_DECL
403 std::ostream&
404 operator<<(std::ostream& os, field f);
405 
406 } // http
407 } // beast
408 } // boost
409 
410 #ifdef BOOST_BEAST_HEADER_ONLY
411 #include <boost/beast/http/impl/field.ipp>
412 #endif
413 
414 #endif
415