このページでは

QHttpHeaderRangeSet Class

QHttpHeaderRangeSet は、HTTP の `Range ` ヘッダーのバイト範囲を表します。詳細...

ヘッダー: #include <QHttpHeaderRangeSet>
CMake: find_package(Qt6 REQUIRED COMPONENTS Network)
target_link_libraries(mytarget PRIVATE Qt6::Network)
qmake: QT += network
以下のように: Qt 6.12
ステータス: テクノロジープレビュー

このクラスはテクノロジープレビュー段階にあり、変更される可能性があります。

QHttpHeaderRangeSet の比較

カテゴリ比較可能な型
等価性QHttpHeaderRangeSet

パブリック関数

QHttpHeaderRangeSet()
QHttpHeaderRangeSet(QSpan<const QHttpHeaderRangeSpec> r)
QHttpHeaderRangeSet(std::initializer_list<QHttpHeaderRangeSpec> r)
QHttpHeaderRangeSet(const QHttpHeaderRangeSet &other)
QHttpHeaderRangeSet(QHttpHeaderRangeSet &&other)
~QHttpHeaderRangeSet()
QSpan<const QHttpHeaderRangeSpec> ranges() const
void setRanges(QSpan<const QHttpHeaderRangeSpec> r)
void swap(QHttpHeaderRangeSet &other)
QHttpHeaderRangeSet &operator=(QHttpHeaderRangeSet &&other)
QHttpHeaderRangeSet &operator=(const QHttpHeaderRangeSet &other)
size_t qHash(const QHttpHeaderRangeSet &key, size_t seed)
bool operator!=(const QHttpHeaderRangeSet &lhs, const QHttpHeaderRangeSet &rhs)
(since 6.12) QDebug operator<<(QDebug debug, const QHttpHeaderRangeSet &ranges)
bool operator==(const QHttpHeaderRangeSet &lhs, const QHttpHeaderRangeSet &rhs)

詳細な説明

QHttpHeaderRangeSet は、RFC 9110 で「range-set」と呼ばれる、ヘッダー内に現れる一連の `QHttpHeaderRangeSpec ` オブジェクトを保持します。

範囲は、指定された順序で保持されます。これは、サーバーに対してそれらの送信が要求される順序であるためです。このクラスはそれらを解釈しません。つまり、重複する範囲や無効な範囲が拒否されたり、統合されたりすることはありません。

各範囲は、RFC 9110 のセクション 14.1.1 で定義されているバイト範囲です:

  • 開始値が指定され、終了値が指定されていない場合(例:"bytes=500-")、QHttpHeaderRangeSpec の値はstart=500 およびend=std::nullopt となります。
  • 終了位置が指定され、開始位置が指定されていない場合(例: "bytes=-500")、QHttpHeaderRangeSpec にはstart=std::nullopt およびend=500 が設定され、最後の500バイトを表します。
  • 両方が指定されている場合(例:「bytes=0-499」)、QHttpHeaderRangeSpec にはstart=0 およびend=499 が含まれます。

QHttpHeaderRangeSpec 、QHttpHeaders::rangeValues()、およびQHttpHeaders::setRangeValues()も参照してください 。

メンバ関数のドキュメント

QHttpHeaderRangeSet::QHttpHeaderRangeSet()

範囲を指定せずに QHttpHeaderRangeSet オブジェクトを作成します。

QHttpHeaderRangeSet::QHttpHeaderRangeSet(QSpan<const QHttpHeaderRangeSpec> r)

r を指定された順序で保持する QHttpHeaderRangeSet オブジェクトを生成します。

setRanges()も参照してください 。

QHttpHeaderRangeSet::QHttpHeaderRangeSet(std::initializer_list<QHttpHeaderRangeSpec> r)

r 内の範囲を、指定された順序で保持する QHttpHeaderRangeSet オブジェクトを作成します。

これはオーバーロードされた関数です。

QHttpHeaderRangeSet::QHttpHeaderRangeSet(const QHttpHeaderRangeSet &other)

other のコピーを作成します。

[constexpr noexcept default] QHttpHeaderRangeSet::QHttpHeaderRangeSet(QHttpHeaderRangeSet &&other)

other からオブジェクトをムーブコンストラクトし、 には範囲が残りません。

[noexcept] QHttpHeaderRangeSet::~QHttpHeaderRangeSet()

そのオブジェクトを破棄します。

[noexcept] QSpan<const QHttpHeaderRangeSpec> QHttpHeaderRangeSet::ranges() const

このオブジェクトが保持する範囲のビューを返します。

返されたビューは、このオブジェクトが変更されるか破棄されるまで有効です。

setRanges()も参照してください 。

void QHttpHeaderRangeSet::setRanges(QSpan<const QHttpHeaderRangeSpec> r)

このオブジェクトが保持する範囲を `r` に設定します。`r` の順序は保持されます。

ranges()も参照してください 。

[noexcept] void QHttpHeaderRangeSet::swap(QHttpHeaderRangeSet &other)

この範囲オブジェクトをother と入れ替えます。この操作は非常に高速で、失敗することはありません。

[noexcept] QHttpHeaderRangeSet &QHttpHeaderRangeSet::operator=(QHttpHeaderRangeSet &&other)

このオブジェクトに `other ` を代入し、このオブジェクトへの参照を返します。other には範囲が残りません。

QHttpHeaderRangeSet &QHttpHeaderRangeSet::operator=(const QHttpHeaderRangeSet &other)

other の内容を割り当て、このオブジェクトへの参照を返します。

関連する非メンバー

[noexcept] size_t qHash(const QHttpHeaderRangeSet &key, size_t seed)

`key` のハッシュ値を返します。計算のシードには `seed ` を使用します。

[noexcept] bool operator!=(const QHttpHeaderRangeSet &lhs, const QHttpHeaderRangeSet &rhs)

lhs とrhs が異なる範囲を保持しているか、あるいは順序が異なるかを返します。

operator==()も参照してください 。

[since 6.12] QDebug operator<<(QDebug debug, const QHttpHeaderRangeSet &ranges)

ストリーム `debug` に `ranges ` を書き込みます。

この関数は Qt 6.12 で導入されました。

[noexcept] bool operator==(const QHttpHeaderRangeSet &lhs, const QHttpHeaderRangeSet &rhs)

lhs とrhs が、同じ順序で同じ範囲を保持しているかどうかを返します。

他のシーケンスコンテナと同様に、範囲は要素ごとに比較されるため、同じバイトの集合を表すものの、範囲が異なる、または順序が異なるオブジェクトは等しくないとみなされます。

operator!=()も参照してください 。

© 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.