QHttpHeaderRangeSpec Struct
QHttpHeaderRangeSpec は、HTTP の `Range ` および `Content-Range ` ヘッダーで使用される 1 バイトの範囲を表します。これは RFC 9110 において「range-spec」と呼ばれています。詳細...
| ヘッダー: | #include <QHttpHeaderRangeSpec> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Network) target_link_libraries(mytarget PRIVATE Qt6::Network) |
| qmake: | QT += network |
| 以下のように: | Qt 6.12 |
| ステータス: | テクノロジープレビュー |
この構造体は技術プレビュー段階にあり、変更される可能性があります。
QHttpHeaderRangeSpec の比較
| カテゴリ | 比較可能な型 |
|---|---|
| 等価性 | QHttpHeaderRangeSpec |
パブリック関数
| bool | isValid() const |
パブリック変数
関連する非メンバー
(since 6.12) size_t | qHash(QHttpHeaderRangeSpec key, size_t seed = 0) |
(since 6.12) QDebug | operator<<(QDebug debug, const QHttpHeaderRangeSpec &range) |
詳細な説明
範囲指定には、オプションの開始位置と終了位置があり、いずれもバイトオフセットとして表されます。開始位置または終了位置が指定されていない場合は、std::nullopt として表されます。
isValid() を使用して、範囲指定が適切な形式であるかどうかを確認してから、QHttpHeaders::setRangeValues() に渡してください。
QHttpHeaderRangeSet 、QHttpHeaders::rangeValues()、およびQHttpHeaders::setRangeValues()も参照してください 。
メンバ関数のドキュメント
[constexpr noexcept] bool QHttpHeaderRangeSpec::isValid() const
範囲指定が正しい形式であれば `true ` を返し、そうでない場合は `false ` を返します。
以下の場合、範囲指定は無効とみなされます。
- 開始値と終了値の両方が `
std::nullopt` である場合。 - 開始値が負の数である場合。
- end の値が負である場合。
- start と end の両方が設定されており、start が end より大きい場合。
メンバー変数のドキュメント
std::optional<qint64> QHttpHeaderRangeSpec::end
範囲の終了バイトのオフセットが含まれます。終了が設定されていない場合は、std::nullopt となります。開始は設定されているが終了が設定されていない範囲(例:bytes=500- )は、指定されたオフセットからリソースの末尾までのすべてのバイトを要求します。
startも参照してください 。
std::optional<qint64> QHttpHeaderRangeSpec::start
範囲の開始バイトオフセットが含まれます。開始が設定されていない場合は、std::nullopt となります。開始がないが終了がある範囲(例:bytes=-500 )は、リソースの最後のNバイトを表します。
endも参照してください 。
関連する非メンバー
[noexcept, since 6.12] size_t qHash(QHttpHeaderRangeSpec key, size_t seed = 0)
`key` のハッシュ値を返します。計算のシードには `seed ` を使用します。
この関数は Qt 6.12 で導入されました。
[since 6.12] QDebug operator<<(QDebug debug, const QHttpHeaderRangeSpec &range)
`range ` を `debug ` ストリームに書き込みます。
この関数は Qt 6.12 で導入されました。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.