Container for a set of HTTP headers. More...
Public Member Functions | |
BHttpHeaders () | |
Construct an empty header list. | |
BHttpHeaders (const BHttpHeaders ©) | |
Copy constructor. More... | |
bool | AddHeader (const char *line) |
Add a new header to the list, from an HTTP header line. More... | |
bool | AddHeader (const char *name, const char *value) |
Add a new header from the given key:value pair. | |
bool | AddHeader (const char *name, int32 value) |
Convenience method to add a header with a numeric value. | |
void | Clear () |
Remove all HTTP headers from the list. | |
int32 | CountHeaders () const |
int32 | HasHeader (const char *name) const |
Find an header by key. More... | |
BHttpHeader & | HeaderAt (int32 index) const |
Find header by position. More... | |
const char * | HeaderValue (const char *name) const |
Container for a set of HTTP headers.
This class allows management of the set of headers for a single HTTP transaction. They are stored in a list and can be iterated on.
BHttpHeaders::BHttpHeaders | ( | const BHttpHeaders & | copy | ) |
Copy constructor.
A deep copy is performed, so modifying the headers in the copy does not change the original.
bool BHttpHeaders::AddHeader | ( | const char * | line | ) |
Add a new header to the list, from an HTTP header line.
Duplicates headers are allowed.
int32 BHttpHeaders::CountHeaders | ( | ) | const |
int32 BHttpHeaders::HasHeader | ( | const char * | name | ) | const |
Find an header by key.
BHttpHeader & BHttpHeaders::HeaderAt | ( | int32 | index | ) | const |
Find header by position.
index | must be in bounds, else this method will crash. |
const char * BHttpHeaders::HeaderValue | ( | const char * | name | ) | const |