Page Speed Optimization Libraries
1.6.29.3
|
00001 // Copyright 2011 Google Inc. 00014 00016 00017 #ifndef NET_INSTAWEB_HTTP_PUBLIC_RESPONSE_HEADERS_PARSER_H_ 00018 #define NET_INSTAWEB_HTTP_PUBLIC_RESPONSE_HEADERS_PARSER_H_ 00019 00020 #include "net/instaweb/util/public/basictypes.h" 00021 #include "net/instaweb/util/public/string.h" 00022 #include "net/instaweb/util/public/string_util.h" 00023 00024 namespace net_instaweb { 00025 00026 class MessageHandler; 00027 class ResponseHeaders; 00028 00030 class ResponseHeadersParser { 00031 public: 00032 explicit ResponseHeadersParser(ResponseHeaders* rh) : response_headers_(rh) { 00033 Clear(); 00034 } 00035 00036 void Clear(); 00037 00039 int ParseChunk(const StringPiece& text, MessageHandler* handler); 00040 00041 bool headers_complete() const { return headers_complete_; } 00042 void set_headers_complete(bool x) { headers_complete_ = x; } 00043 00044 private: 00045 ResponseHeaders* response_headers_; 00046 00047 bool parsing_http_; 00048 bool parsing_value_; 00049 bool headers_complete_; 00050 GoogleString parse_name_; 00051 GoogleString parse_value_; 00052 00053 DISALLOW_COPY_AND_ASSIGN(ResponseHeadersParser); 00054 }; 00055 00056 } 00057 00058 #endif ///< NET_INSTAWEB_HTTP_PUBLIC_RESPONSE_HEADERS_PARSER_H_