mavtables  0.2.1
MAVLink router and firewall.
Functions
IPAddress.cpp File Reference
#include <algorithm>
#include <memory>
#include <set>
#include <sstream>
#include <stdexcept>
#include <string>
#include <vector>
#include <cstring>
#include <netdb.h>
#include <netinet/in.h>
#include <boost/algorithm/string.hpp>
#include "config.hpp"
#include "DNSLookupError.hpp"
#include "IPAddress.hpp"
#include "utility.hpp"
Include dependency graph for IPAddress.cpp:

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &os, const IPAddress &ipaddress)
 

Function Documentation

◆ operator<<()

std::ostream& operator<< ( std::ostream &  os,
const IPAddress ipaddress 
)

Print the IP address to the given output stream.

The format is "<IP Address>" or "<IP Address>:<Port Number>" if the port number is nonzero an "<IP Address>" if the port is 0.

Some examples are:

  • 127.0.0.1
  • 127.0.0.1:14555
  • 183.125.120.42:443
Note
The string constructor IPAddress(std::string) and the output stream operator are inverses and thus:
std::string addr = "127.0.0.1:14555"
str(IPAddress(addr)) == addr
Parameters
osThe output stream to print to.
ipaddressThe IP address to print.
Returns
The output stream.

Definition at line 340 of file IPAddress.cpp.

References to_bytes().

Here is the call graph for this function: