mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Common/Network: Get rid of out parameters for MAC address utilities
Given we have std::array and std::optional, we can use these in conjunction with one another to avoid the need for out parameters.
This commit is contained in:
@ -4,6 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
@ -21,7 +23,9 @@ enum
|
||||
MAC_ADDRESS_SIZE = 6
|
||||
};
|
||||
|
||||
void GenerateMacAddress(const MACConsumer type, u8* mac);
|
||||
std::string MacAddressToString(const u8* mac);
|
||||
bool StringToMacAddress(const std::string& mac_string, u8* mac);
|
||||
using MACAddress = std::array<u8, MAC_ADDRESS_SIZE>;
|
||||
|
||||
MACAddress GenerateMacAddress(MACConsumer type);
|
||||
std::string MacAddressToString(const MACAddress& mac);
|
||||
std::optional<MACAddress> StringToMacAddress(const std::string& mac_string);
|
||||
} // namespace Common
|
||||
|
Reference in New Issue
Block a user