#include <RemoteViz/Rendering/HTTPHeaders.h>
Public Member Functions | |
HTTPHeaders () | |
Creates an empty object. | |
HTTPHeaders (const HTTPHeaders &obj) | |
Copy constructor. | |
HTTPHeaders & | operator= (const HTTPHeaders &obj) |
Copy assignment operator. | |
~HTTPHeaders () | |
Destructor. | |
void | add (const std::string &name, const std::string &value) |
Adds the given header value under the given name. | |
void | remove (const std::string &name) |
Removes the header value under the given name. | |
void | clear () |
Removes all headers. | |
size_t | count () const |
Gets the number of HTTP headers. | |
bool | exists (const std::string &name) const |
Determines if the headers collection contains a header of the specified name, with any value. | |
const std::string & | getValue (const std::string &name) const |
Retrieves the value of a given header. | |
const std::string & | getNameAt (size_t index) const |
Retrieves the header name from a collection index. | |
This class represents the header configuration options for an HTTP request and response.
Note that HTTPHeaders treats header names in a case-insensitive manner.
Definition at line 48 of file HTTPHeaders.h.
RemoteViz::Rendering::HTTPHeaders::HTTPHeaders | ( | ) |
Creates an empty object.
RemoteViz::Rendering::HTTPHeaders::HTTPHeaders | ( | const HTTPHeaders & | obj | ) |
Copy constructor.
RemoteViz::Rendering::HTTPHeaders::~HTTPHeaders | ( | ) |
Destructor.
void RemoteViz::Rendering::HTTPHeaders::add | ( | const std::string & | name, |
const std::string & | value | ||
) |
Adds the given header value under the given name.
If a header already exists with the given name, its value will be overwritten.
name | the header to add to the collection. |
value | the content of the header. |
void RemoteViz::Rendering::HTTPHeaders::clear | ( | ) |
Removes all headers.
size_t RemoteViz::Rendering::HTTPHeaders::count | ( | ) | const |
Gets the number of HTTP headers.
bool RemoteViz::Rendering::HTTPHeaders::exists | ( | const std::string & | name | ) | const |
Determines if the headers collection contains a header of the specified name, with any value.
param name the name of the header to check
const std::string & RemoteViz::Rendering::HTTPHeaders::getNameAt | ( | size_t | index | ) | const |
Retrieves the header name from a collection index.
index | index of the header to retrieve |
const std::string & RemoteViz::Rendering::HTTPHeaders::getValue | ( | const std::string & | name | ) | const |
Retrieves the value of a given header.
name | the name of the header to check |
HTTPHeaders & RemoteViz::Rendering::HTTPHeaders::operator= | ( | const HTTPHeaders & | obj | ) |
Copy assignment operator.
void RemoteViz::Rendering::HTTPHeaders::remove | ( | const std::string & | name | ) |
Removes the header value under the given name.
name | the name of the header to remove from the collection. |