ams: std::optional -> util::optional

This commit is contained in:
Michael Scire 2021-07-08 02:37:26 -07:00
parent 9df13781c2
commit a7c14e03b9
59 changed files with 950 additions and 147 deletions

View file

@ -85,12 +85,12 @@ namespace ams::pgl::srv {
}
}
std::optional<os::ProcessId> GetRunningApplicationProcessId() {
util::optional<os::ProcessId> GetRunningApplicationProcessId() {
os::ProcessId process_id;
if (R_SUCCEEDED(pm::shell::GetApplicationProcessIdForShell(std::addressof(process_id)))) {
return process_id;
} else {
return std::nullopt;
return util::nullopt;
}
}

View file

@ -131,7 +131,7 @@ namespace ams::pgl::srv {
return ResultSuccess();
}
Result GetContentPath(lr::Path *out, ncm::ContentType type, std::optional<u8> index) const {
Result GetContentPath(lr::Path *out, ncm::ContentType type, util::optional<u8> index) const {
switch (this->extension_type) {
case ExtensionType::Nsp: return this->GetContentPathInNsp(out, type, index);
case ExtensionType::Nspd: return this->GetContentPathInNspd(out, type, index);
@ -155,7 +155,7 @@ namespace ams::pgl::srv {
return this->program_index;
}
private:
Result GetContentPathInNsp(lr::Path *out, ncm::ContentType type, std::optional<u8> index) const {
Result GetContentPathInNsp(lr::Path *out, ncm::ContentType type, util::optional<u8> index) const {
/* Create a reader. */
auto reader = ncm::PackagedContentMetaReader(this->content_meta_buffer.Get(), this->content_meta_buffer.GetSize());
@ -185,7 +185,7 @@ namespace ams::pgl::srv {
return ResultSuccess();
}
Result GetContentPathInNspd(lr::Path *out, ncm::ContentType type, std::optional<u8> index) const {
Result GetContentPathInNspd(lr::Path *out, ncm::ContentType type, util::optional<u8> index) const {
/* Get the content name. */
const char *content_name = nullptr;
switch (type) {