QHttpHeaderRangeSet Class
QHttpHeaderRangeSet representa los rangos de bytes de un encabezado HTTP « Range ». Más información...
| Encabezado: | #include <QHttpHeaderRangeSet> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Network) target_link_libraries(mytarget PRIVATE Qt6::Network) |
| qmake: | QT += network |
| Desde: | Qt 6.12 |
| Estado: | Versión preliminar |
Esta clase se encuentra en fase de vista previa tecnológica y está sujeta a cambios.
Comparaciones de QHttpHeaderRangeSet
| Categoría | Tipos comparables |
|---|---|
| igualdad | QHttpHeaderRangeSet |
Funciones 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) |
Elementos no miembros relacionados
| 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) |
Descripción detallada
QHttpHeaderRangeSet contiene una secuencia de objetos ` QHttpHeaderRangeSpec `, tal y como aparecen en dicho encabezado, lo que la RFC 9110 denomina «conjunto de rangos».
Los rangos se mantienen en el orden en que se proporcionaron, ya que ese es el orden en el que se solicita al servidor que los envíe. La clase no los interpreta: no se rechazan ni se fusionan los rangos superpuestos ni los no válidos.
Cada rango es un rango de bytes, tal y como se define en la sección 14.1.1 del RFC 9110:
- Si se especifica el inicio pero no el final (p. ej., «bytes=500-»), el « QHttpHeaderRangeSpec » tendrá «
start=500» y «end=std::nullopt». - Si se especifica el final pero no el inicio (p. ej., «bytes=-500»), el QHttpHeaderRangeSpec tendrá
start=std::nulloptyend=500, que representan los últimos 500 bytes. - Si se especifican ambos (p. ej., «bytes=0-499»), el QHttpHeaderRangeSpec tendrá
start=0yend=499.
Véase también QHttpHeaderRangeSpec, QHttpHeaders::rangeValues() y QHttpHeaders::setRangeValues().
Documentación de las funciones miembro
QHttpHeaderRangeSet::QHttpHeaderRangeSet()
Crea un objeto QHttpHeaderRangeSet sin rangos.
QHttpHeaderRangeSet::QHttpHeaderRangeSet(QSpan<const QHttpHeaderRangeSpec> r)
Crea un objeto `QHttpHeaderRangeSet` que contiene ` r`, en el orden indicado.
Véase también setRanges().
QHttpHeaderRangeSet::QHttpHeaderRangeSet(std::initializer_list<QHttpHeaderRangeSpec> r)
Crea un objeto `QHttpHeaderRangeSet` que contiene los rangos de ` r`, en el orden indicado.
Esta es una función sobrecargada.
QHttpHeaderRangeSet::QHttpHeaderRangeSet(const QHttpHeaderRangeSet &other)
Crea una copia de other.
[constexpr noexcept default] QHttpHeaderRangeSet::QHttpHeaderRangeSet(QHttpHeaderRangeSet &&other)
Crea el objeto mediante «move» a partir de other, que queda sin rangos.
[noexcept] QHttpHeaderRangeSet::~QHttpHeaderRangeSet()
Destruye el objeto.
[noexcept] QSpan<const QHttpHeaderRangeSpec> QHttpHeaderRangeSet::ranges() const
Devuelve una vista de los rangos que contiene este objeto.
La vista devuelta es válida hasta que este objeto se modifique o se elimine.
Véase también setRanges().
void QHttpHeaderRangeSet::setRanges(QSpan<const QHttpHeaderRangeSpec> r)
Establece los rangos que contiene este objeto en r. Conserva el orden de r.
Véase también ranges().
[noexcept] void QHttpHeaderRangeSet::swap(QHttpHeaderRangeSet &other)
Cambia este objeto de rangos por other. Esta operación es muy rápida y nunca falla.
[noexcept] QHttpHeaderRangeSet &QHttpHeaderRangeSet::operator=(QHttpHeaderRangeSet &&other)
La operación «move-assigns» asigna « other » a este objeto y devuelve una referencia a este objeto. « other » queda sin rangos.
QHttpHeaderRangeSet &QHttpHeaderRangeSet::operator=(const QHttpHeaderRangeSet &other)
Asigna el contenido de « other » y devuelve una referencia a este objeto.
Elementos no miembros relacionados
[noexcept] size_t qHash(const QHttpHeaderRangeSet &key, size_t seed)
Devuelve el valor hash de « key », utilizando « seed » como semilla para el cálculo.
[noexcept] bool operator!=(const QHttpHeaderRangeSet &lhs, const QHttpHeaderRangeSet &rhs)
Devuelve si « lhs » y « rhs » contienen rangos diferentes o si los contienen en un orden distinto.
Véase también operator==().
[since 6.12] QDebug operator<<(QDebug debug, const QHttpHeaderRangeSet &ranges)
Escribe ranges en el flujo debug.
Esta función se introdujo en Qt 6.12.
[noexcept] bool operator==(const QHttpHeaderRangeSet &lhs, const QHttpHeaderRangeSet &rhs)
Devuelve si lhs y rhs contienen los mismos rangos en el mismo orden.
Al igual que con otros contenedores de secuencias, los rangos se comparan elemento por elemento, por lo que los objetos que representan el mismo conjunto de bytes, pero que contienen rangos diferentes o los contienen en un orden distinto, no se consideran iguales.
Véase también 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.