4#include <QRandomGenerator>
37 IPAddress(
const QVector<quint8> &address);
43 QVector<quint8>
toArray()
const;
46 quint32
toInt()
const;
82 QVector<quint8> m_address{QVector<quint8>() << 0 << 0 << 0 << 0};
Represents an IPv4 address.
Definition ipaddress.h:27
QString toString() const
Converts the IP address to a string format.
Definition ipaddress.cpp:9
quint32 toInt() const
Converts the IP address to an integer format.
Definition ipaddress.cpp:19
bool operator==(const IPAddress &other) const
Overload of the equality operator.
Definition ipaddress.cpp:44
static IPAddress getRandomAddress(bool isLocal=false)
Generates a random IP address.
Definition ipaddress.cpp:28
QVector< quint8 > toArray() const
Converts the IP address to a byte array.
Definition ipaddress.cpp:16
bool operator<(const IPAddress &other) const
Overload of the less than operator.
Definition ipaddress.cpp:40
IPAddress()=default
Default constructor.