29 std::optional<qint64> start;
30 std::optional<qint64> end;
32 constexpr bool isValid()
const noexcept
36 if (start && start < 0)
40 if (start && end && *start > *end)
45#ifndef QT_NO_DEBUG_STREAM
46 friend Q_NETWORK_EXPORT QDebug operator<<(QDebug debug,
const QHttpHeaderRangeSpec &range);
50 friend constexpr bool comparesEqual(
const QHttpHeaderRangeSpec &lhs,
51 const QHttpHeaderRangeSpec &rhs)
noexcept
53 return lhs.start == rhs.start && lhs.end == rhs.end;
55 Q_DECLARE_EQUALITY_COMPARABLE_LITERAL_TYPE(QHttpHeaderRangeSpec)
57 friend size_t qHash(QHttpHeaderRangeSpec range, size_t seed = 0)
noexcept
59 return qHashMulti(seed, range.start, range.end);
67 QExplicitlySharedDataPointer<QHttpHeaderRangeSetPrivate> d_ptr;
68 Q_DECLARE_PRIVATE(QHttpHeaderRangeSet)
70 Q_NETWORK_EXPORT QHttpHeaderRangeSet();
71 Q_NETWORK_EXPORT QHttpHeaderRangeSet(
const QHttpHeaderRangeSet &other);
72 QHttpHeaderRangeSet(QHttpHeaderRangeSet &&) =
default;
73 Q_NETWORK_EXPORT Q_IMPLICIT QHttpHeaderRangeSet(QSpan<
const QHttpHeaderRangeSpec> r);
74 Q_IMPLICIT QHttpHeaderRangeSet(std::initializer_list<QHttpHeaderRangeSpec> r)
75 : QHttpHeaderRangeSet(QSpan<
const QHttpHeaderRangeSpec>{r}) {}
76 Q_NETWORK_EXPORT QHttpHeaderRangeSet &operator=(
const QHttpHeaderRangeSet &other);
77 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QHttpHeaderRangeSet)
78 Q_NETWORK_EXPORT ~QHttpHeaderRangeSet();
80 void swap(QHttpHeaderRangeSet &other)
noexcept { d_ptr.swap(other.d_ptr); }
82 Q_NETWORK_EXPORT QSpan<
const QHttpHeaderRangeSpec> ranges()
const noexcept;
83 Q_NETWORK_EXPORT
void setRanges(QSpan<
const QHttpHeaderRangeSpec> r);
94#ifndef QT_NO_DEBUG_STREAM
95 friend Q_NETWORK_EXPORT QDebug operator<<(QDebug debug,
const QHttpHeaderRangeSet &ranges);
98 Q_NETWORK_EXPORT
friend bool comparesEqual(
const QHttpHeaderRangeSet &lhs,
99 const QHttpHeaderRangeSet &rhs)
noexcept;
100 Q_DECLARE_EQUALITY_COMPARABLE(QHttpHeaderRangeSet)
102 Q_NETWORK_EXPORT
friend size_t qHash(
const QHttpHeaderRangeSet &key, size_t seed)
noexcept;
103 friend size_t qHash(
const QHttpHeaderRangeSet &key)
noexcept {
return qHash(key, size_t{0}); }
112 Q_GADGET_EXPORT(Q_NETWORK_EXPORT)
295 Q_ENUM(WellKnownHeader)
360 Q_NETWORK_EXPORT qsizetype
size()
const noexcept;
362 bool isEmpty()
const noexcept {
return size() == 0; }
366 Q_NETWORK_EXPORT
static QHttpHeaders
368 Q_NETWORK_EXPORT
static QHttpHeaders
370 Q_NETWORK_EXPORT
static QHttpHeaders
378#ifndef QT_NO_DEBUG_STREAM
382#ifndef QT_NO_DATASTREAM
387 Q_ALWAYS_INLINE
void verify([[maybe_unused]] qsizetype pos = 0,
388 [[maybe_unused]] qsizetype n = 1)
const
391 Q_ASSERT(pos <= size());
393 Q_ASSERT(n <= size() - pos);
395 QExplicitlySharedDataPointer<QHttpHeadersPrivate> d;