19 #ifndef NET_INSTAWEB_HTTP_PUBLIC_HTTP_VALUE_H_
20 #define NET_INSTAWEB_HTTP_PUBLIC_HTTP_VALUE_H_
30 namespace net_instaweb {
32 class ResponseHeaders;
46 bool Empty()
const {
return storage_.empty(); }
89 storage_ = src->storage_;
90 contents_size_ = src->contents_size();
97 size_t size()
const {
return storage_.
size(); }
98 int64 contents_size() {
return contents_size_; }
103 MessageHandler* handler);
106 MessageHandler* handler);
109 friend class HTTPValueTest;
112 char type_identifier()
const {
return *storage_.data(); }
114 unsigned int SizeOfFirstChunk()
const;
115 void SetSizeOfFirstChunk(
unsigned int size);
116 int64 ComputeContentsSize()
const;
122 SharedString storage_;
124 int64 contents_size_;
static bool Decode(StringPiece encoded_value, GoogleString *http_string, MessageHandler *handler)
Definition: http_value.h:38
static bool Encode(StringPiece http_string, GoogleString *encoded_value, MessageHandler *handler)
Convert from raw HTTP stream to HTTPValue format.
const SharedString & share() const
Access the shared string, for insertion into a cache via Put.
Definition: http_value.h:95
bool unique() const
Definition: shared_string.h:146
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
bool Empty() const
Is this HTTPValue empty.
Definition: http_value.h:46
bool ExtractContents(StringPiece *str) const
bool Link(const SharedString &src, ResponseHeaders *headers, MessageHandler *handler)
Definition: shared_string.h:40
Interface for writing bytes to an output stream.
Definition: writer.h:29
int size() const
Computes the size, taking into account any removed prefix or suffix.
Definition: shared_string.h:125
void Clear()
Clears the value (both headers and content)
bool unique() const
Tests whether this reference is the only active one to the string object.
Definition: http_value.h:75
Definition: message_handler.h:39
void SetHeaders(ResponseHeaders *headers)
void Link(HTTPValue *src)
Definition: http_value.h:87
bool ExtractHeaders(ResponseHeaders *headers, MessageHandler *handler) const
Retrieves the headers, returning false if empty.
virtual bool Write(const StringPiece &str, MessageHandler *handler)