diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-04-08 17:19:35 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-04-08 17:19:35 +0200 |
commit | 3e175c9a96977f14a8adcf1b5a021ccb48f3b194 (patch) | |
tree | 73e705e124cebe98aa432568fba35c11b8f039d6 | |
parent | 93a4a4c5975d8fe0d8ed1191509664ef22342b5d (diff) | |
download | serenity-3e175c9a96977f14a8adcf1b5a021ccb48f3b194.zip |
LibGUI: Move GSocketAddress to its own file.
-rw-r--r-- | LibGUI/GSocket.h | 31 | ||||
-rw-r--r-- | LibGUI/GSocketAddress.h | 31 |
2 files changed, 32 insertions, 30 deletions
diff --git a/LibGUI/GSocket.h b/LibGUI/GSocket.h index 06cf7c1da2..a6a0d7c3e9 100644 --- a/LibGUI/GSocket.h +++ b/LibGUI/GSocket.h @@ -1,36 +1,7 @@ #pragma once #include <LibGUI/GIODevice.h> -#include <AK/AKString.h> -#include <Kernel/Net/IPv4.h> - -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 <LibGUI/GSocketAddress.h> class GNotifier; diff --git a/LibGUI/GSocketAddress.h b/LibGUI/GSocketAddress.h new file mode 100644 index 0000000000..c333e64a4e --- /dev/null +++ b/LibGUI/GSocketAddress.h @@ -0,0 +1,31 @@ +#pragma once + +#include <Kernel/Net/IPv4.h> + +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; +}; |