moonlight-qt/app/backend/nvaddress.h

40 lines
786 B
C
Raw Normal View History

2021-07-03 04:54:17 +00:00
#pragma once
#include <QHostAddress>
2021-07-03 05:00:27 +00:00
#define DEFAULT_HTTP_PORT 47989
#define DEFAULT_HTTPS_PORT 47984
2021-07-03 04:54:17 +00:00
class NvAddress
{
public:
NvAddress();
explicit NvAddress(QString addr, uint16_t port);
explicit NvAddress(QHostAddress addr, uint16_t port);
uint16_t port() const;
void setPort(uint16_t port);
QString address() const;
void setAddress(QString addr);
void setAddress(QHostAddress addr);
bool isNull() const;
QString toString() const;
bool operator==(const NvAddress& other) const
{
return m_Address == other.m_Address &&
m_Port == other.m_Port;
}
bool operator!=(const NvAddress& other) const
{
return !operator==(other);
}
private:
QString m_Address;
uint16_t m_Port;
};