Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
response_headers_parser.h
Go to the documentation of this file.
1 // Copyright 2011 Google Inc.
14 
16 
17 #ifndef PAGESPEED_KERNEL_HTTP_RESPONSE_HEADERS_PARSER_H_
18 #define PAGESPEED_KERNEL_HTTP_RESPONSE_HEADERS_PARSER_H_
19 
23 
24 namespace net_instaweb {
25 
26 class MessageHandler;
27 class ResponseHeaders;
28 
31  public:
32  explicit ResponseHeadersParser(ResponseHeaders* rh) : response_headers_(rh) {
33  Clear();
34  }
35 
36  void Clear();
37 
39  int ParseChunk(const StringPiece& text, MessageHandler* handler);
40 
41  bool headers_complete() const { return headers_complete_; }
42  void set_headers_complete(bool x) { headers_complete_ = x; }
43 
44  private:
45  ResponseHeaders* response_headers_;
46 
47  bool parsing_http_;
48  bool parsing_value_;
49  bool headers_complete_;
50  GoogleString parse_name_;
51  GoogleString parse_value_;
52 
53 
54 };
55 
56 }
57 
58 #endif
Read/write API for HTTP response headers.
Definition: response_headers.h:37
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
int ParseChunk(const StringPiece &text, MessageHandler *handler)
Parse a chunk of HTTP response header. Returns number of bytes consumed.
Parses a stream of HTTP header text into a ResponseHeaders instance.
Definition: response_headers_parser.h:30
Definition: message_handler.h:39