A container for an “entity tag” from an HTTP server. This is used to identify a particular version of a document or resource, particularly useful for verifying caches.
HTTPEntityTag(std::string const &text)¶
HTTPEntityTag(bool weak, std::string const &tag)¶
HTTPEntityTag(HTTPEntityTag const ©)¶
This constructor accepts an explicit weak flag and a literal (not quoted) tag string.
This constructor accepts a string as formatted from an HTTP server (e.g. the tag is quoted, with an optional W/ prefix.)
int compare_to(HTTPEntityTag const &other) const¶
Returns a number less than zero if this
HTTPEntityTagsorts before the other one, greater than zero if it sorts after, or zero if they are equivalent.
std::string get_string(void) const¶
Returns the entity tag formatted for sending to an HTTP server (the tag is quoted, with a conditional W prefix).
std::string const &get_tag(void) const¶
Returns the tag as a literal string.
bool is_weak(void) const¶
Returns true if the entity tag is marked as “weak”. A consistent weak entity tag does not guarantee that its resource has not changed in any way, but it does promise that the resource has not changed in any semantically meaningful way.
void output(std::ostream &out) const¶
bool strong_equiv(HTTPEntityTag const &other) const¶
Returns true if the two tags have “strong” equivalence: they are the same tag, and both are “strong”.