Nesta página

QHttpHeaderRangeSet Class

QHttpHeaderRangeSet representa os intervalos de bytes de um cabeçalho HTTP “ Range ”. Mais...

Cabeçalho: #include <QHttpHeaderRangeSet>
CMake: find_package(Qt6 REQUIRED COMPONENTS Network)
target_link_libraries(mytarget PRIVATE Qt6::Network)
qmake: QT += network
Desde: Qt 6.12
Status: Prévia tecnológica

Esta classe está em pré-visualização tecnológica e está sujeita a alterações.

Comparações do QHttpHeaderRangeSet

CategoriaTipos comparáveis
igualdadeQHttpHeaderRangeSet

Funções públicas

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)

Descrição detalhada

QHttpHeaderRangeSet contém uma sequência de objetos ` QHttpHeaderRangeSpec `, conforme aparecem nesse cabeçalho, o que a RFC 9110 denomina de “conjunto de intervalos” ( range-set).

Os intervalos são mantidos na ordem em que foram fornecidos, pois essa é a ordem em que o servidor é solicitado a enviá-los. A classe não os interpreta: nem intervalos sobrepostos nem inválidos são rejeitados ou mesclados.

Cada intervalo é um intervalo de bytes, conforme definido na Seção 14.1.1 da RFC 9110:

  • Se o início for especificado, mas o fim não (por exemplo, “bytes=500-”), o ` QHttpHeaderRangeSpec ` terá ` start=500 ` e ` end=std::nullopt`.
  • Se o fim for especificado, mas o início não (por exemplo, “bytes=-500”), o QHttpHeaderRangeSpec terá start=std::nullopt e end=500, representando os últimos 500 bytes.
  • Se ambos forem especificados (por exemplo, “bytes=0-499”), o QHttpHeaderRangeSpec terá start=0 e end=499.

Veja também ` QHttpHeaderRangeSpec`, ` QHttpHeaders::rangeValues()` e ` QHttpHeaders::setRangeValues()`.

Documentação das funções-membro

QHttpHeaderRangeSet::QHttpHeaderRangeSet()

Cria um objeto QHttpHeaderRangeSet sem intervalos.

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

Cria um objeto `QHttpHeaderRangeSet` que contém ` r`, na ordem especificada.

Veja também setRanges().

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

Cria um objeto `QHttpHeaderRangeSet` que contém os intervalos em ` r`, na ordem especificada.

Esta é uma função sobrecarregada.

QHttpHeaderRangeSet::QHttpHeaderRangeSet(const QHttpHeaderRangeSet &other)

Cria uma cópia de other.

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

Constrói o objeto por meio de `move` a partir de ` other`, que fica sem intervalos.

[noexcept] QHttpHeaderRangeSet::~QHttpHeaderRangeSet()

Destrói o objeto.

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

Retorna uma visualização dos intervalos contidos neste objeto.

A visualização retornada é válida até que este objeto seja modificado ou destruído.

Veja também setRanges().

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

Define os intervalos contidos neste objeto como r. Mantém a ordem de r.

Veja também ranges().

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

Troca este objeto de intervalos por other. Essa operação é muito rápida e nunca falha.

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

A função `move-assigns` atribui ` other ` a este objeto e retorna uma referência a ele. O ` other ` fica sem intervalos.

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

Atribui o conteúdo de ` other ` e retorna uma referência a esse objeto.

Não-membros relacionados

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

Retorna o valor hash de key, utilizando seed como semente para o cálculo.

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

Retorna se lhs e rhs contêm intervalos diferentes ou se os apresentam em uma ordem diferente.

Veja também operator==().

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

Grava ranges no fluxo debug.

Essa função foi introduzida no Qt 6.12.

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

Retorna se ` lhs ` e ` rhs ` contêm os mesmos intervalos na mesma ordem.

Assim como em outros contêineres de sequência, os intervalos são comparados elemento por elemento; portanto, objetos que representam o mesmo conjunto de bytes, mas contêm intervalos diferentes ou os apresentam em uma ordem diferente, não são considerados iguais.

Veja também 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.