1 #ifndef _HTTP_HEADER_H_
2 #define _HTTP_HEADER_H_
69 in.setstate(istream::failbit);
126 if(getline(in, line)) {
127 size_t line_size = line.size();
128 if(line_size <= 0) in.setstate(istream::eofbit);
129 else if((line[0] ==
'\r') || (line[0] ==
'\n')) in.setstate(istream::eofbit);
131 size_t pos = line.find(
':');
133 if(pos == string::npos) in.setstate(istream::failbit);
135 header.
name = line.substr(0, pos);
137 if((pos += 2) >= line_size) in.setstate(istream::failbit);
138 else header.
value = line.substr(pos, line_size - pos - 1);
199 return (strcasecmp(a.
name.c_str(), b.
name()) == 0);
Contains the definition of a set of classes for working easily with the protocol HTTP.
Definition: header.cc:4
static const char CRLF[]
String with the characters 13 (CR) and 10 (LF), the line separator used in the HTTP protocol...
Definition: protocol.h:31