#include <http.hpp>
Public Member Functions | |
uint32_t | getInt () const |
Retrieve the integer value of the IPv4 address. | |
Address | operator= (uint32_t data_) |
Assign the IPv4 address from an integer. | |
Address | operator= (Address address) |
Address (const Address &address) | |
Address (uint32_t data_) | |
Construct the IPv4 address from an integer. | |
Address () | |
Constructs from a value of 0.0.0.0 (0). | |
void | assign (const char *start, const char *end) |
Assign the IPv4 address from a string of characters. | |
Private Attributes | |
uint32_t | data |
Data representation of the IPv4 address. | |
Friends | |
bool | operator== (Address x, Address y) |
Compare two Address values. | |
bool | operator> (Address x, Address y) |
Compare two Address values. | |
bool | operator< (Address x, Address y) |
Compare two Address values. | |
bool | operator<= (Address x, Address y) |
Compare two Address values. | |
bool | operator>= (Address x, Address y) |
Compare two Address values. | |
Address | operator& (Address x, Address y) |
Bitwise AND two Address values. | |
template<class charT , class Traits > | |
std::basic_ostream< charT, Traits > & | operator<< (std::basic_ostream< charT, Traits > &os, const Address &address) |
Address stream insertion operation. | |
template<class charT , class Traits > | |
std::basic_istream< charT, Traits > & | operator>> (std::basic_istream< charT, Traits > &is, Address &address) |
Address stream extractor operation. |
This class stores IPv4 addresses as unsigned 32bit integers. It does this as opposed to storing the string itself to facilitate efficient logging and processing of the address. The class possesses full IO and comparison capabilities as well as allowing bitwise AND operations for netmask calculation.
Definition at line 75 of file http.hpp.
Fastcgipp::Http::Address::Address | ( | const Address & | address | ) | [inline] |
Fastcgipp::Http::Address::Address | ( | uint32_t | data_ | ) | [inline] |
Fastcgipp::Http::Address::Address | ( | ) | [inline] |
void Fastcgipp::Http::Address::assign | ( | const char * | start, | |
const char * | end | |||
) |
Assign the IPv4 address from a string of characters.
In order for this to work the string must represent an IPv4 address in textual decimal form and nothing else. Example: "127.0.0.1".
[in] | start | First character of the string |
[in] | end | Last character of the string + 1 |
Definition at line 28 of file http.cpp.
References Fastcgipp::Http::atoi(), and data.
Referenced by Fastcgipp::Http::Session< charT >::fill().
uint32_t Fastcgipp::Http::Address::getInt | ( | ) | const [inline] |
Address Fastcgipp::Http::Address::operator= | ( | uint32_t | data_ | ) | [inline] |
std::basic_ostream<charT, Traits>& operator<< | ( | std::basic_ostream< charT, Traits > & | os, | |
const Address & | address | |||
) | [friend] |
Address stream insertion operation.
This stream inserter obeys all stream manipulators regarding alignment, field width and numerical base.
std::basic_istream<charT, Traits>& operator>> | ( | std::basic_istream< charT, Traits > & | is, | |
Address & | address | |||
) | [friend] |
Address stream extractor operation.
In order for this to work the stream must be positioned on at the start of a standard decimal representation of a IPv4 address. Example: "127.0.0.1".
uint32_t Fastcgipp::Http::Address::data [private] |
Data representation of the IPv4 address.
Definition at line 116 of file http.hpp.
Referenced by assign(), getInt(), Fastcgipp::Http::operator&(), Fastcgipp::Http::operator<(), Fastcgipp::Http::operator<=(), operator=(), Fastcgipp::Http::operator==(), Fastcgipp::Http::operator>(), and Fastcgipp::Http::operator>=().