http_header_help.h

Go to the documentation of this file.
00001 /*
00002 **  ClanLib SDK
00003 **  Copyright (c) 1997-2011 The ClanLib Team
00004 **
00005 **  This software is provided 'as-is', without any express or implied
00006 **  warranty.  In no event will the authors be held liable for any damages
00007 **  arising from the use of this software.
00008 **
00009 **  Permission is granted to anyone to use this software for any purpose,
00010 **  including commercial applications, and to alter it and redistribute it
00011 **  freely, subject to the following restrictions:
00012 **
00013 **  1. The origin of this software must not be misrepresented; you must not
00014 **     claim that you wrote the original software. If you use this software
00015 **     in a product, an acknowledgment in the product documentation would be
00016 **     appreciated but is not required.
00017 **  2. Altered source versions must be plainly marked as such, and must not be
00018 **     misrepresented as being the original software.
00019 **  3. This notice may not be removed or altered from any source distribution.
00020 **
00021 **  Note: Some of the libraries ClanLib may link to may have additional
00022 **  requirements or restrictions.
00023 **
00024 **  File Author(s):
00025 **
00026 **    Magnus Norddahl
00027 */
00028 
00031 
00032 #pragma once
00033 
00034 #include "../api_network.h"
00035 
00039 class CL_API_NETWORK CL_HTTPHeaderAccept
00040 {
00043 
00044 public:
00045         CL_StringRef type;
00046 
00047         CL_StringRef subtype;
00048 
00049         CL_StringRef type_params;
00050 
00051         CL_StringRef quality;
00052 
00053         CL_StringRef accept_params;
00055 };
00056 
00060 class CL_API_NETWORK CL_HTTPHeaderAcceptCharset
00061 {
00064 
00065 public:
00066         CL_StringRef name;
00067 
00068         CL_StringRef quality;
00070 };
00071 
00075 class CL_API_NETWORK CL_HTTPHeaderAcceptEncoding
00076 {
00079 
00080 public:
00081         CL_StringRef name;
00082 
00083         CL_StringRef quality;
00085 };
00086 
00090 class CL_API_NETWORK CL_HTTPHeaderAcceptLanguage
00091 {
00094 
00095 public:
00096         CL_StringRef name;
00097 
00098         CL_StringRef variant;
00099 
00100         CL_StringRef quality;
00102 };
00103 
00107 class CL_API_NETWORK CL_HTTPHeaderContentLanguage
00108 {
00111 
00112 public:
00113         CL_StringRef name;
00114 
00115         CL_StringRef variant;
00117 };
00118 
00122 class CL_API_NETWORK CL_HTTPHeaderContentRange
00123 {
00126 
00127 public:
00128         CL_StringRef range_type;  // always 'bytes'
00129 
00130         CL_StringRef first_byte_pos;
00131 
00132         CL_StringRef last_byte_pos;
00133 
00134         CL_StringRef instance_length;
00136 };
00137 
00141 class CL_API_NETWORK CL_HTTPHeaderContentType
00142 {
00145 
00146 public:
00147         CL_StringRef type;
00148 
00149         CL_StringRef params;
00151 };
00152 
00156 class CL_API_NETWORK CL_HTTPHeaderRange
00157 {
00160 
00161 public:
00162         CL_StringRef first_byte_pos;
00163 
00164         CL_StringRef last_byte_pos;
00166 };
00167 
00171 class CL_API_NETWORK CL_HTTPHeaderTE // (TransferEncodingAccept)
00172 {
00175 
00176 public:
00177         CL_StringRef name;
00178 
00179         CL_StringRef quality;
00180 
00181         CL_StringRef accept_params;
00183 };
00184 
00188 class CL_API_NETWORK CL_HTTPHeaderVia
00189 {
00192 
00193 public:
00194         CL_StringRef protocol_name;
00195 
00196         CL_StringRef protocol_version;
00197 
00198         CL_StringRef received_by;
00200 };
00201 
00205 class CL_API_NETWORK CL_HTTPHeaderWarning
00206 {
00209 
00210 public:
00211         CL_StringRef code;
00212 
00213         CL_StringRef agent;
00214 
00215         CL_StringRef text;
00216 
00217         CL_StringRef date;
00219 };
00220 
00224 class CL_API_NETWORK CL_HTTPHeaderHelp
00225 {
00228 
00229 public:
00230         static CL_StringRef get_header_value(
00231                 const CL_StringRef &name,
00232                 const CL_StringRef &header_lines);
00233 
00234         static std::vector<CL_HTTPHeaderAccept> get_accept(const CL_StringRef &header_lines);
00235 
00236         static std::vector<CL_HTTPHeaderAcceptCharset> get_accept_charset(const CL_StringRef &header_lines);
00237 
00238         static std::vector<CL_HTTPHeaderAcceptEncoding> get_accept_encoding(const CL_StringRef &header_lines);
00239 
00240         static std::vector<CL_HTTPHeaderAcceptLanguage> get_accept_language(const CL_StringRef &header_lines);
00241 
00242         static std::vector<CL_StringRef> get_accept_range(const CL_StringRef &header_lines);
00243 
00249         static CL_StringRef get_age(const CL_StringRef &header_lines);
00250 
00251         static std::vector<CL_StringRef> get_allow(const CL_StringRef &header_lines);
00252 
00258         static CL_StringRef get_authorization(const CL_StringRef &header_lines);
00259 
00260         static std::vector<CL_StringRef> get_cache_control(const CL_StringRef &header_lines);
00261 
00262         static std::vector<CL_StringRef> get_connection(const CL_StringRef &header_lines);
00263 
00264         static std::vector<CL_StringRef> get_content_encoding(const CL_StringRef &header_lines);
00265 
00266         static std::vector<CL_HTTPHeaderContentLanguage> get_content_language(const CL_StringRef &header_lines);
00267 
00273         static CL_StringRef get_content_length(const CL_StringRef &header_lines);
00274 
00280         static CL_StringRef get_content_location(const CL_StringRef &header_lines);
00281 
00287         static CL_StringRef get_content_md5(const CL_StringRef &header_lines);
00288 
00294         static CL_HTTPHeaderContentRange get_content_range(const CL_StringRef &header_lines);
00295 
00301         static CL_HTTPHeaderContentType get_content_type(const CL_StringRef &header_lines);
00302 
00308         static CL_StringRef get_date(const CL_StringRef &header_lines);
00309 
00315         static CL_StringRef get_etag(const CL_StringRef &header_lines);
00316 
00317         static std::vector<CL_StringRef> get_expect(const CL_StringRef &header_lines);
00318 
00324         static CL_StringRef get_expires(const CL_StringRef &header_lines);
00325 
00331         static CL_StringRef get_from(const CL_StringRef &header_lines);
00332 
00338         static CL_StringRef get_host(const CL_StringRef &header_lines);
00339 
00340         static std::vector<CL_StringRef> get_if_match(const CL_StringRef &header_lines);
00341 
00347         static CL_StringRef get_if_modified_since(const CL_StringRef &header_lines);
00348 
00354         static CL_StringRef get_if_none_match(const CL_StringRef &header_lines);
00355 
00361         static CL_StringRef get_if_range(const CL_StringRef &header_lines);
00362 
00368         static CL_StringRef get_if_unmodified_since(const CL_StringRef &header_lines);
00369 
00375         static CL_StringRef get_last_modified(const CL_StringRef &header_lines);
00376 
00382         static CL_StringRef get_location(const CL_StringRef &header_lines);
00383 
00389         static CL_StringRef get_max_forwards(const CL_StringRef &header_lines);
00390 
00391         static std::vector<CL_StringRef> get_pragma(const CL_StringRef &header_lines);
00392 
00398         static CL_StringRef get_proxy_authenticate(const CL_StringRef &header_lines);
00399 
00405         static CL_StringRef get_proxy_authorization(const CL_StringRef &header_lines);
00406 
00407         static std::vector<CL_HTTPHeaderRange> get_range(const CL_StringRef &header_lines, CL_StringRef &out_range_type);
00408 
00414         static CL_StringRef get_referer(const CL_StringRef &header_lines);
00415 
00421         static CL_StringRef get_retry_after(const CL_StringRef &header_lines);
00422 
00428         static CL_StringRef get_server(const CL_StringRef &header_lines);
00429 
00430         static std::vector<CL_HTTPHeaderTE> get_te(const CL_StringRef &header_lines);
00431 
00432         static std::vector<CL_StringRef> get_trailer(const CL_StringRef &header_lines);
00433 
00434         static std::vector<CL_StringRef> get_transfer_encoding(const CL_StringRef &header_lines);
00435 
00441         static CL_StringRef get_upgrade(const CL_StringRef &header_lines);
00442 
00448         static CL_StringRef get_user_agent(const CL_StringRef &header_lines);
00449 
00450         static std::vector<CL_StringRef> get_vary(const CL_StringRef &header_lines);
00451 
00452         static std::vector<CL_HTTPHeaderVia> get_via(const CL_StringRef &header_lines);
00453 
00459         static CL_HTTPHeaderWarning get_warning(const CL_StringRef &header_lines);
00460 
00466         static CL_StringRef get_www_authenticate(const CL_StringRef &header_lines);
00468 };
00469