![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
QHttpHeaderRangeSet represents the byte ranges of an HTTP {Range} header.
More...
#include <qhttpheaders.h>
Public Member Functions | |
| Q_NETWORK_EXPORT | QHttpHeaderRangeSet () |
| Constructs a QHttpHeaderRangeSet object with no ranges. | |
| Q_NETWORK_EXPORT | QHttpHeaderRangeSet (const QHttpHeaderRangeSet &other) |
| Creates a copy of other. | |
| QHttpHeaderRangeSet (QHttpHeaderRangeSet &&)=default | |
| Move-constructs the object from other, which is left with no ranges. | |
| Q_NETWORK_EXPORT Q_IMPLICIT | QHttpHeaderRangeSet (QSpan< const QHttpHeaderRangeSpec > r) |
| Constructs a QHttpHeaderRangeSet object holding r, in the given order. | |
| Q_IMPLICIT | QHttpHeaderRangeSet (std::initializer_list< QHttpHeaderRangeSpec > r) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Constructs a QHttpHeaderRangeSet object holding the ranges in r, in the given order. | |
| Q_NETWORK_EXPORT QHttpHeaderRangeSet & | operator= (const QHttpHeaderRangeSet &other) |
| Assigns the contents of other and returns a reference to this object. | |
| Q_NETWORK_EXPORT | ~QHttpHeaderRangeSet () |
| Destroys the object. | |
| void | swap (QHttpHeaderRangeSet &other) noexcept |
| \memberswap{ranges object} | |
| Q_NETWORK_EXPORT QSpan< const QHttpHeaderRangeSpec > | ranges () const noexcept |
| Returns a view of the ranges held by this object. | |
| Q_NETWORK_EXPORT void | setRanges (QSpan< const QHttpHeaderRangeSpec > r) |
| Sets the ranges held by this object to r. | |
Friends | |
| Q_NETWORK_EXPORT QDebug | operator<< (QDebug debug, const QHttpHeaderRangeSet &ranges) |
| Q_NETWORK_EXPORT friend bool | comparesEqual (const QHttpHeaderRangeSet &lhs, const QHttpHeaderRangeSet &rhs) |
| Q_NETWORK_EXPORT friend size_t | qHash (const QHttpHeaderRangeSet &key, size_t seed) |
| \qhash{QHttpHeaderRangeSet} | |
| size_t | qHash (const QHttpHeaderRangeSet &key) noexcept |
QHttpHeaderRangeSet represents the byte ranges of an HTTP {Range} header.
QHttpHeaderRangeSet holds a sequence of QHttpHeaderRangeSpec objects, as they appear in such a header, which RFC 9110 calls a {range-set}.
The ranges are kept in the order in which they were given, because that is the order in which a server is asked to send them. The class does not interpret them: neither overlapping nor invalid ranges are rejected or merged.
Each range is a byte range, as defined in \l{https://datatracker.ietf.org/doc/html/rfc9110#section-14.1.1}{RFC 9110 Section 14.1.1}: \list
{start=500} and {end=std::nullopt}. {start=std::nullopt} and {end=500}, representing the last 500 bytes. {start=0} and {end=499}. \endlistDefinition at line 65 of file qhttpheaders.h.
|
default |
Constructs a QHttpHeaderRangeSet object with no ranges.
|
default |
Creates a copy of other.
|
default |
Move-constructs the object from other, which is left with no ranges.
| QHttpHeaderRangeSet::QHttpHeaderRangeSet | ( | QSpan< const QHttpHeaderRangeSpec > | r | ) |
Constructs a QHttpHeaderRangeSet object holding r, in the given order.
Definition at line 252 of file qhttpheaders.cpp.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Constructs a QHttpHeaderRangeSet object holding the ranges in r, in the given order.
Definition at line 74 of file qhttpheaders.h.
|
default |
Destroys the object.
|
default |
Assigns the contents of other and returns a reference to this object.
Move-assigns other to this object and returns a reference to this object.
other is left with no ranges.
|
noexcept |
Returns a view of the ranges held by this object.
The returned view is valid until this object is modified or destroyed.
Definition at line 308 of file qhttpheaders.cpp.
| void QHttpHeaderRangeSet::setRanges | ( | QSpan< const QHttpHeaderRangeSpec > | r | ) |
Sets the ranges held by this object to r.
Preserves the order of r.
Definition at line 318 of file qhttpheaders.cpp.
|
inlinenoexcept |
\memberswap{ranges object}
Definition at line 80 of file qhttpheaders.h.
|
friend |
Definition at line 347 of file qhttpheaders.cpp.
|
friend |
|
friend |
Definition at line 103 of file qhttpheaders.h.
|
friend |
\qhash{QHttpHeaderRangeSet}
Definition at line 359 of file qhttpheaders.cpp.