/* */ #ifndef _D_HTTP_HEADER_PROCESSOR_H_ #define _D_HTTP_HEADER_PROCESSOR_H_ #include "common.h" #include "SharedHandle.h" #include #include namespace aria2 { class HttpHeader; class HttpHeaderProcessor { private: std::stringstream strm; int32_t _limit; void checkHeaderLimit(int32_t incomingLength); public: HttpHeaderProcessor(); ~HttpHeaderProcessor(); void update(const char* data, int32_t length); void update(const std::string& data); /** * Returns true if end of header is reached. */ bool eoh() const; /** * Retruns the number of bytes beyond the end of header. */ int32_t getPutBackDataLength() const; std::pair > getHttpStatusHeader(); std::string getHeaderString() const; void clear(); void setHeaderLimit(int32_t limit) { _limit = limit; } }; typedef SharedHandle HttpHeaderProcessorHandle; } // namespace aria2 #endif // _D_HTTP_HEADER_PROCESSOR_H_