Loading...
Searching...
No Matches
juce_IPAddress.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
class JUCE_API IPAddress final
{
public:
//==============================================================================
static IPAddress any() noexcept;
static IPAddress broadcast() noexcept;
static IPAddress local (bool IPv6 = false) noexcept;
//==============================================================================
static void findAllAddresses (Array<IPAddress>& results, bool includeIPv6 = false);
static Array<IPAddress> getAllAddresses (bool includeIPv6 = false);
static IPAddress getLocalAddress (bool includeIPv6 = false);
//==============================================================================
IPAddress() noexcept;
explicit IPAddress (const uint8* bytes, bool IPv6 = false) noexcept;
explicit IPAddress (const uint16* bytes) noexcept;
IPAddress (uint8 address1, uint8 address2, uint8 address3, uint8 address4) noexcept;
IPAddress (uint16 address1, uint16 address2, uint16 address3, uint16 address4,
uint16 address5, uint16 address6, uint16 address7, uint16 address8) noexcept;
explicit IPAddress (uint32 asNativeEndian32Bit) noexcept;
explicit IPAddress (const String& address);
bool isNull() const;
//==============================================================================
String toString() const;
int compare (const IPAddress&) const noexcept;
bool operator== (const IPAddress&) const noexcept;
bool operator!= (const IPAddress&) const noexcept;
bool operator< (const IPAddress&) const noexcept;
bool operator> (const IPAddress&) const noexcept;
bool operator<= (const IPAddress&) const noexcept;
bool operator>= (const IPAddress&) const noexcept;
//==============================================================================
uint8 address[16];
bool isIPv6 = false;
//==============================================================================
static String getFormattedAddress (const String& unformattedAddress);
static bool isIPv4MappedAddress (const IPAddress& mappedAddress);
static IPAddress convertIPv4MappedAddressToIPv4 (const IPAddress& mappedAddress);
static IPAddress convertIPv4AddressToIPv4Mapped (const IPAddress& addressToMap);
static IPAddress getInterfaceBroadcastAddress (const IPAddress& interfaceAddress);
};
} // namespace juce
juce::Array
Definition juce_Array.h:56
juce::IPAddress::getAllAddresses
static Array< IPAddress > getAllAddresses(bool includeIPv6=false)
Definition juce_IPAddress.cpp:368
juce::IPAddress::getLocalAddress
static IPAddress getLocalAddress(bool includeIPv6=false)
Definition juce_IPAddress.cpp:357
juce::IPAddress::isNull
bool isNull() const
Definition juce_IPAddress.cpp:101
juce::IPAddress::local
static IPAddress local(bool IPv6=false) noexcept
Definition juce_IPAddress.cpp:243
juce::IPAddress::isIPv4MappedAddress
static bool isIPv4MappedAddress(const IPAddress &mappedAddress)
Definition juce_IPAddress.cpp:320
juce::IPAddress::any
static IPAddress any() noexcept
Definition juce_IPAddress.cpp:241
juce::IPAddress::getFormattedAddress
static String getFormattedAddress(const String &unformattedAddress)
Definition juce_IPAddress.cpp:246
juce::IPAddress::compare
int compare(const IPAddress &) const noexcept
Definition juce_IPAddress.cpp:214
juce::IPAddress::toString
String toString() const
Definition juce_IPAddress.cpp:177
juce::IPAddress::broadcast
static IPAddress broadcast() noexcept
Definition juce_IPAddress.cpp:242
juce::IPAddress::findAllAddresses
static void findAllAddresses(Array< IPAddress > &results, bool includeIPv6=false)
juce::IPAddress::address
uint8 address[16]
Definition juce_IPAddress.h:113
juce::IPAddress::convertIPv4AddressToIPv4Mapped
static IPAddress convertIPv4AddressToIPv4Mapped(const IPAddress &addressToMap)
Definition juce_IPAddress.cpp:347
juce::IPAddress::convertIPv4MappedAddressToIPv4
static IPAddress convertIPv4MappedAddressToIPv4(const IPAddress &mappedAddress)
Definition juce_IPAddress.cpp:335
juce::IPAddress::IPAddress
IPAddress() noexcept
Definition juce_IPAddress.cpp:39
juce::IPAddress::getInterfaceBroadcastAddress
static IPAddress getInterfaceBroadcastAddress(const IPAddress &interfaceAddress)
juce::String
Definition juce_String.h:53