Panda3D
Public Member Functions | List of all members
HTTPEntityTag Class Reference

A container for an "entity tag" from an HTTP server. More...

#include "httpEntityTag.h"

Public Member Functions

 HTTPEntityTag (const std::string &text)
 This constructor accepts a string as formatted from an HTTP server (e.g. More...
 
 HTTPEntityTag (bool weak, const std::string &tag)
 This constructor accepts an explicit weak flag and a literal (not quoted) tag string. More...
 
 HTTPEntityTag (const HTTPEntityTag &copy)
 
int compare_to (const HTTPEntityTag &other) const
 Returns a number less than zero if this HTTPEntityTag sorts before the other one, greater than zero if it sorts after, or zero if they are equivalent. More...
 
std::string get_string () const
 Returns the entity tag formatted for sending to an HTTP server (the tag is quoted, with a conditional W prefix). More...
 
const std::string & get_tag () const
 Returns the tag as a literal string. More...
 
bool is_weak () const
 Returns true if the entity tag is marked as "weak". More...
 
bool operator != (const HTTPEntityTag &other) const
 
bool operator< (const HTTPEntityTag &other) const
 
void operator= (const HTTPEntityTag &copy)
 
bool operator== (const HTTPEntityTag &other) const
 The == operator tests object equivalence; see also strong_equiv() and weak_equiv() for the two kinds of HTTP equivalence. More...
 
void output (std::ostream &out) const
 
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". More...
 
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 "weak". More...
 

Detailed Description

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.

Definition at line 24 of file httpEntityTag.h.

Constructor & Destructor Documentation

◆ HTTPEntityTag() [1/2]

HTTPEntityTag::HTTPEntityTag ( const std::string &  text)

This constructor accepts a string as formatted from an HTTP server (e.g.

the tag is quoted, with an optional W/ prefix.)

Definition at line 24 of file httpEntityTag.cxx.

◆ HTTPEntityTag() [2/2]

HTTPEntityTag::HTTPEntityTag ( bool  weak,
const std::string &  tag 
)
inline

This constructor accepts an explicit weak flag and a literal (not quoted) tag string.

Definition at line 27 of file httpEntityTag.I.

Member Function Documentation

◆ compare_to()

int HTTPEntityTag::compare_to ( const HTTPEntityTag other) const
inline

Returns a number less than zero if this HTTPEntityTag sorts before the other one, greater than zero if it sorts after, or zero if they are equivalent.

Definition at line 123 of file httpEntityTag.I.

◆ get_string()

string HTTPEntityTag::get_string ( ) const

Returns the entity tag formatted for sending to an HTTP server (the tag is quoted, with a conditional W prefix).

Definition at line 56 of file httpEntityTag.cxx.

◆ get_tag()

const std::string & HTTPEntityTag::get_tag ( ) const
inline

Returns the tag as a literal string.

Definition at line 67 of file httpEntityTag.I.

◆ is_weak()

bool HTTPEntityTag::is_weak ( ) const
inline

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.

Definition at line 59 of file httpEntityTag.I.

◆ operator==()

bool HTTPEntityTag::operator== ( const HTTPEntityTag other) const
inline

The == operator tests object equivalence; see also strong_equiv() and weak_equiv() for the two kinds of HTTP equivalence.

Definition at line 94 of file httpEntityTag.I.

◆ strong_equiv()

bool HTTPEntityTag::strong_equiv ( const HTTPEntityTag other) const
inline

Returns true if the two tags have "strong" equivalence: they are the same tag, and both are "strong".

Definition at line 76 of file httpEntityTag.I.

◆ weak_equiv()

bool HTTPEntityTag::weak_equiv ( const HTTPEntityTag other) const
inline

Returns true if the two tags have "weak" equivalence: they are the same tag, and one or both may be "weak".

Definition at line 85 of file httpEntityTag.I.


The documentation for this class was generated from the following files: