Stroika Library 3.0d18
 
Loading...
Searching...
No Matches
Headers.inl
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4
6
7 /*
8 ********************************************************************************
9 ********************************* HTTP::Headers ********************************
10 ********************************************************************************
11 */
12 inline void Headers::Add (const KeyValuePair<String, String>& hrdAndValue)
13 {
14 Add (hrdAndValue.fKey, hrdAndValue.fValue);
15 }
16 inline void Headers::Add (const pair<String, String>& hrdAndValue)
17 {
18 Add (hrdAndValue.first, hrdAndValue.second);
19 }
20 inline void Headers::operator+= (const pair<String, String>& hrdAndValue)
21 {
22 Add (hrdAndValue);
23 }
24 inline void Headers::operator+= (const KeyValuePair<String, String>& hrdAndValue)
25 {
26 Add (hrdAndValue);
27 }
28 inline void Headers::operator+= (const Headers& headers)
29 {
30 AddAll (headers);
31 }
32 template <>
33 inline Iterable<KeyValuePair<String, String>> Headers::As () const
34 {
35 return As<Collection<KeyValuePair<String, String>>> ();
36 }
37 inline bool Headers::operator== (const Headers& rhs) const
38 {
39 using ExtrasComparer = Collection<KeyValuePair<String, String>>::SequentialEqualsComparer<>;
40 // clang-format off
41 return
42 ExtrasComparer{}(fExtraHeaders_, rhs.fExtraHeaders_)
43 and fCacheControl_ == rhs.fCacheControl_
44 and fContentLength_ == rhs.fContentLength_
45 and fContentType_ == rhs.fContentType_
46 and fCookieList_ == rhs.fCookieList_
47 and fDate_ == rhs.fDate_
48 and fETag_ == rhs.fETag_
49 and fHost_ == rhs.fHost_
50 and fIfNoneMatch_ == rhs.fIfNoneMatch_
51 and fSetCookieList_ == rhs.fSetCookieList_
52 and fTransferEncoding_ == rhs.fTransferEncoding_
53 and fVary_ == rhs.fVary_
54 ;
55 // clang-format on
56 }
57
58}
nonvirtual void Add(const String &headerName, const String &value)
Definition Headers.cpp:528
nonvirtual void AddAll(const Headers &headers)
not the same as assignment - only for headers set in argument, replace those in this header object.
Definition Headers.cpp:537