17 INLINE HTTPEntityTag::
26 INLINE HTTPEntityTag::
27 HTTPEntityTag(
bool weak,
const std::string &tag) :
36 INLINE HTTPEntityTag::
46 INLINE
void HTTPEntityTag::
77 return _tag == other._tag && !_weak && !other._weak;
86 return _tag == other._tag;
95 return _weak == other._weak && _tag == other._tag;
101 INLINE
bool HTTPEntityTag::
109 INLINE
bool HTTPEntityTag::
111 if (_weak != other._weak) {
112 return (
int)_weak < (int)other._weak;
114 return _tag < other._tag;
124 if (_weak != other._weak) {
125 return (
int)_weak - (int)other._weak;
127 return strcmp(_tag.c_str(), other._tag.c_str());
133 INLINE
void HTTPEntityTag::
134 output(std::ostream &out)
const {
139 INLINE std::ostream &
140 operator << (std::ostream &out,
const HTTPEntityTag &entityTag) {
141 entityTag.output(out);
bool is_weak() const
Returns true if the entity tag is marked as "weak".
A container for an "entity tag" from an HTTP server.
bool operator==(const HTTPEntityTag &other) const
The == operator tests object equivalence; see also strong_equiv() and weak_equiv() for the two kinds ...
int compare_to(const HTTPEntityTag &other) const
Returns a number less than zero if this HTTPEntityTag sorts before the other one, greater than zero i...
std::string get_string() const
Returns the entity tag formatted for sending to an HTTP server (the tag is quoted,...
bool strong_equiv(const HTTPEntityTag &other) const
Returns true if the two tags have "strong" equivalence: they are the same tag, and both are "strong".
const std::string & get_tag() const
Returns the tag as a literal string.
bool weak_equiv(const HTTPEntityTag &other) const
Returns true if the two tags have "weak" equivalence: they are the same tag, and one or both may be "...