![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
QHttpHeaderRange represents a single byte range as used in the HTTP {Range} and {Content-Range} headers.
More...
#include <qhttpheaders.h>
Public Member Functions | |
| constexpr | QHttpHeaderRange () noexcept=default |
| Constructs a default-initialized range. | |
| constexpr | QHttpHeaderRange (std::optional< qint64 > start, std::optional< qint64 > end) noexcept |
| Constructs a range with start and end byte offsets. | |
| constexpr std::optional< qint64 > | start () const noexcept |
Returns the start byte offset of the range, or {std::nullopt} if no start was set. | |
| constexpr std::optional< qint64 > | end () const noexcept |
Returns the end byte offset of the range, or {std::nullopt} if no end was set. | |
| constexpr void | setStart (std::optional< qint64 > start) noexcept |
| Sets the start byte offset to start. | |
| constexpr void | setEnd (std::optional< qint64 > end) noexcept |
| Sets the end byte offset to end. | |
| constexpr bool | isValid () const noexcept |
Returns true if the range is well-formed, false otherwise. | |
Friends | |
| Q_NETWORK_EXPORT QDebug | operator<< (QDebug debug, const QHttpHeaderRange &range) |
| constexpr bool | comparesEqual (const QHttpHeaderRange &lhs, const QHttpHeaderRange &rhs) noexcept |
QHttpHeaderRange represents a single byte range as used in the HTTP {Range} and {Content-Range} headers.
A range has an optional start and an optional end, both expressed as byte offsets. A missing start or end is represented as {std::nullopt}.
Use \l isValid() to check whether a range is well-formed before passing it to \l QHttpHeaders::setRangeValues().
Definition at line 23 of file qhttpheaders.h.
|
constexprdefaultnoexcept |
|
inlineconstexprnoexcept |
Constructs a range with start and end byte offsets.
Either or both may be {std::nullopt} to represent an open-ended range; see \l isValid() for the constraints.
Definition at line 27 of file qhttpheaders.h.
References QHttpHeaderRange().
Referenced by QHttpHeaderRange().
|
inlineconstexprnoexcept |
Returns the end byte offset of the range, or {std::nullopt} if no end was set.
A range with a start but without an end (e.g., {bytes=500-}) requests all bytes from the given offset to the end of the resource.
Definition at line 31 of file qhttpheaders.h.
|
inlineconstexprnoexcept |
Returns true if the range is well-formed, false otherwise.
A range is considered invalid if: \list
{std::nullopt}. Definition at line 35 of file qhttpheaders.h.
Sets the end byte offset to end.
Pass {std::nullopt} to clear the end.
Definition at line 33 of file qhttpheaders.h.
Sets the start byte offset to start.
Pass {std::nullopt} to clear the start.
Definition at line 32 of file qhttpheaders.h.
|
inlineconstexprnoexcept |
Returns the start byte offset of the range, or {std::nullopt} if no start was set.
A range without a start but with an end (e.g., {bytes=-500}) represents the last N bytes of the resource.
Definition at line 30 of file qhttpheaders.h.
|
friend |
Definition at line 53 of file qhttpheaders.h.
|
friend |