Qt 4.8
Classes | Functions
qnetworkcookie_p.h File Reference
#include "QtCore/qdatetime.h"

Go to the source code of this file.

Classes

class  QNetworkCookiePrivate
 

Functions

static bool isLWS (register char c)
 
static int nextNonWhitespace (const QByteArray &text, int from)
 

Function Documentation

◆ isLWS()

static bool isLWS ( register char  c)
inlinestatic

Definition at line 76 of file qnetworkcookie_p.h.

Referenced by isSeparator(), nextField(), and nextNonWhitespace().

77 {
78  return c == ' ' || c == '\t' || c == '\r' || c == '\n';
79 }
unsigned char c[8]
Definition: qnumeric_p.h:62

◆ nextNonWhitespace()

static int nextNonWhitespace ( const QByteArray text,
int  from 
)
static

Definition at line 81 of file qnetworkcookie_p.h.

Referenced by nextField(), parseHttpOptionHeader(), and QNetworkCookiePrivate::parseSetCookieHeaderLine().

82 {
83  // RFC 2616 defines linear whitespace as:
84  // LWS = [CRLF] 1*( SP | HT )
85  // We ignore the fact that CRLF must come as a pair at this point
86  // It's an invalid HTTP header if that happens.
87  while (from < text.length()) {
88  if (isLWS(text.at(from)))
89  ++from;
90  else
91  return from; // non-whitespace
92  }
93 
94  // reached the end
95  return text.length();
96 }
static bool isLWS(register char c)
int length() const
Same as size().
Definition: qbytearray.h:356
char at(int i) const
Returns the character at index position i in the byte array.
Definition: qbytearray.h:413