From 3e175c9a96977f14a8adcf1b5a021ccb48f3b194 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 8 Apr 2019 17:19:35 +0200 Subject: [PATCH] LibGUI: Move GSocketAddress to its own file. --- LibGUI/GSocket.h | 31 +------------------------------ LibGUI/GSocketAddress.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 30 deletions(-) create mode 100644 LibGUI/GSocketAddress.h diff --git a/LibGUI/GSocket.h b/LibGUI/GSocket.h index 06cf7c1da24..a6a0d7c3e98 100644 --- a/LibGUI/GSocket.h +++ b/LibGUI/GSocket.h @@ -1,36 +1,7 @@ #pragma once #include -#include -#include - -class GSocketAddress { -public: - enum class Type { Invalid, IPv4, Local }; - - GSocketAddress() { } - GSocketAddress(const IPv4Address& address) - : m_type(Type::IPv4) - , m_ipv4_address(address) - { - } - - Type type() const { return m_type; } - bool is_valid() const { return m_type != Type::Invalid; } - IPv4Address ipv4_address() const { return m_ipv4_address; } - - String to_string() const - { - switch (m_type) { - case Type::IPv4: return m_ipv4_address.to_string(); - default: return "[GSocketAddress]"; - } - } - -private: - Type m_type { Type::Invalid }; - IPv4Address m_ipv4_address; -}; +#include class GNotifier; diff --git a/LibGUI/GSocketAddress.h b/LibGUI/GSocketAddress.h new file mode 100644 index 00000000000..c333e64a4e6 --- /dev/null +++ b/LibGUI/GSocketAddress.h @@ -0,0 +1,31 @@ +#pragma once + +#include + +class GSocketAddress { +public: + enum class Type { Invalid, IPv4, Local }; + + GSocketAddress() { } + GSocketAddress(const IPv4Address& address) + : m_type(Type::IPv4) + , m_ipv4_address(address) + { + } + + Type type() const { return m_type; } + bool is_valid() const { return m_type != Type::Invalid; } + IPv4Address ipv4_address() const { return m_ipv4_address; } + + String to_string() const + { + switch (m_type) { + case Type::IPv4: return m_ipv4_address.to_string(); + default: return "[GSocketAddress]"; + } + } + +private: + Type m_type { Type::Invalid }; + IPv4Address m_ipv4_address; +};