Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
IfNoneMatch.h
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Foundation_IO_Network_HTTP_IfNoneMatch_h_
5#define _Stroika_Foundation_IO_Network_HTTP_IfNoneMatch_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
10#include "Stroika/Foundation/Containers/Sequence.h"
11
12#include "ETag.h"
13
14/**
15 */
16
18
19 using Characters::String;
20
21 /**
22 * If-None-Match is typically a list of just one ETag (@see https://tools.ietf.org/html/rfc7232#section-3.2)
23 */
24 struct IfNoneMatch {
25
27
28 /**
29 * If ill-format or missing, return nullopt, no exception.
30 */
31 static optional<IfNoneMatch> Parse (const String& wireFormat);
32
34
35 // true iff fETags is empty
36 bool IsAsterisk () const;
37
38 /**
39 * This As<> encodes the ETag as specified in HTTP SPEC (URL)
40 *
41 * T can be among these:
42 * o String
43 */
44 template <typename T>
45 T As () const;
46
47 /**
48 * @see Characters::ToString ();
49 */
50 nonvirtual String ToString () const;
51
52 /**
53 */
54 nonvirtual strong_ordering operator<=> (const IfNoneMatch& rhs) const = default;
55 };
56
57}
58
59/*
60 ********************************************************************************
61 ***************************** Implementation Details ***************************
62 ********************************************************************************
63 */
64#include "IfNoneMatch.inl"
65
66#endif /*_Stroika_Foundation_IO_Network_HTTP_IfNoneMatch_h_*/
String is like std::u32string, except it is much easier to use, often much more space efficient,...
Definition String.h:201
A generalization of a vector: a container whose elements are keyed by the natural numbers.
Definition Sequence.h:187
static optional< IfNoneMatch > Parse(const String &wireFormat)