JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::MACAddress Class Referencefinal

Represents a MAC network card adapter address ID. More...

#include <juce_MACAddress.h>

Collaboration diagram for juce::MACAddress:

Public Member Functions

 MACAddress () noexcept
 Creates a null address (00-00-00-00-00-00). More...
 
 MACAddress (const MACAddress &) noexcept
 Creates a copy of another address. More...
 
 MACAddress (const uint8 bytes[6]) noexcept
 Creates an address from 6 bytes. More...
 
 MACAddress (StringRef address)
 Creates an address from a hex string. More...
 
const uint8getBytes () const noexcept
 Returns a pointer to the 6 bytes that make up this address. More...
 
bool isNull () const noexcept
 Returns true if this address is null (00-00-00-00-00-00). More...
 
bool operator!= (const MACAddress &) const noexcept
 
MACAddressoperator= (const MACAddress &) noexcept
 Creates a copy of another address. More...
 
bool operator== (const MACAddress &) const noexcept
 
int64 toInt64 () const noexcept
 Returns the address in the lower 6 bytes of an int64. More...
 
String toString () const
 Returns a dash-separated string in the form "11-22-33-44-55-66". More...
 
String toString (StringRef separator) const
 Returns a hex string of this address, using a custom separator between each byte. More...
 

Static Public Member Functions

static void findAllAddresses (Array< MACAddress > &results)
 Populates a list of the MAC addresses of all the available network cards. More...
 
static Array< MACAddressgetAllAddresses ()
 Returns a list of the MAC addresses of all the available network cards. More...
 

Private Attributes

uint8 address [6]
 

Detailed Description

Represents a MAC network card adapter address ID.

{Core}

Constructor & Destructor Documentation

◆ MACAddress() [1/4]

juce::MACAddress::MACAddress ( )
noexcept

Creates a null address (00-00-00-00-00-00).

◆ MACAddress() [2/4]

juce::MACAddress::MACAddress ( const MACAddress )
noexcept

Creates a copy of another address.

◆ MACAddress() [3/4]

juce::MACAddress::MACAddress ( const uint8  bytes[6])
explicitnoexcept

Creates an address from 6 bytes.

◆ MACAddress() [4/4]

juce::MACAddress::MACAddress ( StringRef  address)
explicit

Creates an address from a hex string.

If the string isn't a 6-byte hex value, this will just default-initialise the object.

Member Function Documentation

◆ findAllAddresses()

static void juce::MACAddress::findAllAddresses ( Array< MACAddress > &  results)
static

Populates a list of the MAC addresses of all the available network cards.

◆ getAllAddresses()

static Array<MACAddress> juce::MACAddress::getAllAddresses ( )
static

Returns a list of the MAC addresses of all the available network cards.

◆ getBytes()

const uint8* juce::MACAddress::getBytes ( ) const
inlinenoexcept

Returns a pointer to the 6 bytes that make up this address.

References juce::operator!=(), and juce::operator==().

◆ isNull()

bool juce::MACAddress::isNull ( ) const
noexcept

Returns true if this address is null (00-00-00-00-00-00).

◆ operator!=()

bool juce::MACAddress::operator!= ( const MACAddress ) const
noexcept

◆ operator=()

MACAddress& juce::MACAddress::operator= ( const MACAddress )
noexcept

Creates a copy of another address.

◆ operator==()

bool juce::MACAddress::operator== ( const MACAddress ) const
noexcept

◆ toInt64()

int64 juce::MACAddress::toInt64 ( ) const
noexcept

Returns the address in the lower 6 bytes of an int64.

This uses a little-endian arrangement, with the first byte of the address being stored in the least-significant byte of the result value.

◆ toString() [1/2]

String juce::MACAddress::toString ( ) const

Returns a dash-separated string in the form "11-22-33-44-55-66".

◆ toString() [2/2]

String juce::MACAddress::toString ( StringRef  separator) const

Returns a hex string of this address, using a custom separator between each byte.

Member Data Documentation

◆ address

uint8 juce::MACAddress::address[6]
private

The documentation for this class was generated from the following file: