28 static constexpr QByteArrayView otherCharacters(
"!#$%&'*+-.^_`|~");
29 static const auto fieldNameChar = [](
char c) {
30 return (
'a' <=
c &&
c <=
'z') || (
'A' <=
c &&
c <=
'Z') || (
'0' <=
c &&
c <=
'9')
31 || otherCharacters.contains(
c);
34 return !
name.empty() && std::all_of(
name.begin(),
name.end(), fieldNameChar);
43 return h.startsWith(
' ') ||
h.startsWith(
'\t');
49 while (
int tail =
header.endsWith(
"\n\r\n") ? 2 :
header.endsWith(
"\n\n") ? 1 : 0)
52 if (
header.size() - (
header.endsWith(
"\r\n") ? 2 : 1) > maxTotalSize)
60 if (
result.size() >= maxFieldCount)
83 }
while (hSpaceStart(
header));
100 static const int minLength = 11;
101 static const int dotPos = 6;
102 static const int spacePos = 8;
103 static const char httpMagic[] =
"HTTP/";
105 if (status.
size() < minLength
107 || status.
at(dotPos) !=
'.'
108 || status.
at(spacePos) !=
' ') {
114 majorVersion = status.
at(dotPos - 1) -
'0';
115 minorVersion = status.
at(dotPos + 1) -
'0';
128 return ok &&
uint(majorVersion) <= 9 &&
uint(minorVersion) <= 9;
139 return fields.
value(
name, defaultValue).toByteArray();
145 if (allValues.isEmpty())
147 return allValues.join(
", ");
198 majorVersion = version;
208 minorVersion = version;
218 reasonPhrase = reason;
bool startsWith(QByteArrayView other) const noexcept
constexpr char at(qsizetype n) const
constexpr QByteArrayView sliced(qsizetype pos) const
constexpr qsizetype size() const noexcept
qsizetype indexOf(QByteArrayView a, qsizetype from=0) const noexcept
\macro QT_RESTRICTED_CAST_FROM_ASCII
int toInt(bool *ok=nullptr, int base=10) const
Returns the string converted to an int using base base, which is 10 by default and must be between 2 ...
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void clear()
Clears the contents of the string and makes it null.
qsizetype size() const noexcept
Returns the number of characters in this string.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
QString trimmed() const &
Combined button and popup list for selecting options.
static QString header(const QString &name)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLfloat GLfloat GLfloat GLfloat h