Replace boost::optional with std::optional where possible
This commit is contained in:
parent
87e16c80ac
commit
d37a2270d6
30 changed files with 104 additions and 106 deletions
|
@ -38,13 +38,13 @@ Loader::ResultStatus Ticket::Load(const std::vector<u8> file_data, std::size_t o
|
|||
return Loader::ResultStatus::Success;
|
||||
}
|
||||
|
||||
boost::optional<std::array<u8, 16>> Ticket::GetTitleKey() const {
|
||||
std::optional<std::array<u8, 16>> Ticket::GetTitleKey() const {
|
||||
HW::AES::InitKeys();
|
||||
std::array<u8, 16> ctr{};
|
||||
std::memcpy(ctr.data(), &ticket_body.title_id, sizeof(u64));
|
||||
HW::AES::SelectCommonKeyIndex(ticket_body.common_key_index);
|
||||
if (!HW::AES::IsNormalKeyAvailable(HW::AES::KeySlotID::TicketCommonKey)) {
|
||||
return boost::none;
|
||||
return {};
|
||||
}
|
||||
auto key = HW::AES::GetNormalKey(HW::AES::KeySlotID::TicketCommonKey);
|
||||
auto title_key = ticket_body.title_key;
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <boost/optional.hpp>
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
#include "common/swap.h"
|
||||
|
@ -48,7 +48,7 @@ public:
|
|||
#pragma pack(pop)
|
||||
|
||||
Loader::ResultStatus Load(const std::vector<u8> file_data, std::size_t offset = 0);
|
||||
boost::optional<std::array<u8, 16>> GetTitleKey() const;
|
||||
std::optional<std::array<u8, 16>> GetTitleKey() const;
|
||||
|
||||
private:
|
||||
Body ticket_body;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue