28 zeromem (address,
sizeof (address));
33 memcpy (address, other.address, sizeof (address));
38 memcpy (address, other.address, sizeof (address));
44 memcpy (address, bytes,
sizeof (address));
52 if (hex.
getSize() ==
sizeof (address))
53 memcpy (address, hex.
getData(),
sizeof (address));
55 zeromem (address,
sizeof (address));
67 for (
size_t i = 0; i <
sizeof (address); ++i)
71 if (i <
sizeof (address) - 1)
82 for (
int i = (
int)
sizeof (address); --i >= 0;)
83 n = (n << 8) | address[i];
97 bool MACAddress::operator== (
const MACAddress& other)
const noexcept {
return memcmp (address, other.address, sizeof (address)) == 0; }
98 bool MACAddress::operator!= (
const MACAddress& other)
const noexcept {
return ! operator== (other); }
size_t getSize() const noexcept
Returns the block's current allocated size, in bytes.
A simple class for holding temporary references to a string literal or String.
static Array< MACAddress > getAllAddresses()
Returns a list of the MAC addresses of all the available network cards.
bool isNull() const noexcept
Returns true if this address is null (00-00-00-00-00-00).
Represents a MAC network card adapter address ID.
String toString() const
Returns a dash-separated string in the form "11-22-33-44-55-66".
void * getData() const noexcept
Returns a void pointer to the data.
MACAddress & operator=(const MACAddress &) noexcept
Creates a copy of another address.
static String toHexString(IntegerType number)
Returns a string representing this numeric value in hexadecimal.
MACAddress() noexcept
Creates a null address (00-00-00-00-00-00).
Holds a resizable array of primitive or copy-by-value objects.
int64 toInt64() const noexcept
Returns the address in the lower 6 bytes of an int64.
static void findAllAddresses(Array< MACAddress > &results)
Populates a list of the MAC addresses of all the available network cards.
String paddedLeft(juce_wchar padCharacter, int minimumLength) const
Returns a copy of this string with the specified character repeatedly added to its beginning until th...
A class to hold a resizable block of raw data.
void loadFromHexString(StringRef sourceHexString)
Parses a string of hexadecimal numbers and writes this data into the memory block.