From 7a5eda59146306dedaf3e6f07f97a8c6898543dd Mon Sep 17 00:00:00 2001 From: Frederic L Date: Tue, 30 Oct 2018 05:03:25 +0100 Subject: global: Use std::optional instead of boost::optional (#1578) * get rid of boost::optional * Remove optional references * Use std::reference_wrapper for optional references * Fix clang format * Fix clang format part 2 * Adressed feedback * Fix clang format and MacOS build --- src/core/file_sys/registered_cache.h | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'src/core/file_sys/registered_cache.h') diff --git a/src/core/file_sys/registered_cache.h b/src/core/file_sys/registered_cache.h index 5beceffb3..6cfb16017 100644 --- a/src/core/file_sys/registered_cache.h +++ b/src/core/file_sys/registered_cache.h @@ -84,7 +84,7 @@ public: bool HasEntry(u64 title_id, ContentRecordType type) const; bool HasEntry(RegisteredCacheEntry entry) const; - boost::optional GetEntryVersion(u64 title_id) const; + std::optional GetEntryVersion(u64 title_id) const; VirtualFile GetEntryUnparsed(u64 title_id, ContentRecordType type) const; VirtualFile GetEntryUnparsed(RegisteredCacheEntry entry) const; @@ -96,11 +96,10 @@ public: std::unique_ptr GetEntry(RegisteredCacheEntry entry) const; std::vector ListEntries() const; - // If a parameter is not boost::none, it will be filtered for from all entries. + // If a parameter is not std::nullopt, it will be filtered for from all entries. std::vector ListEntriesFilter( - boost::optional title_type = boost::none, - boost::optional record_type = boost::none, - boost::optional title_id = boost::none) const; + std::optional title_type = {}, std::optional record_type = {}, + std::optional title_id = {}) const; // Raw copies all the ncas from the xci/nsp to the csache. Does some quick checks to make sure // there is a meta NCA and all of them are accessible. @@ -125,12 +124,11 @@ private: std::vector AccumulateFiles() const; void ProcessFiles(const std::vector& ids); void AccumulateYuzuMeta(); - boost::optional GetNcaIDFromMetadata(u64 title_id, ContentRecordType type) const; + std::optional GetNcaIDFromMetadata(u64 title_id, ContentRecordType type) const; VirtualFile GetFileAtID(NcaID id) const; VirtualFile OpenFileOrDirectoryConcat(const VirtualDir& dir, std::string_view path) const; InstallResult RawInstallNCA(std::shared_ptr nca, const VfsCopyFunction& copy, - bool overwrite_if_exists, - boost::optional override_id = boost::none); + bool overwrite_if_exists, std::optional override_id = {}); bool RawInstallYuzuMeta(const CNMT& cnmt); VirtualDir dir; @@ -153,7 +151,7 @@ public: bool HasEntry(u64 title_id, ContentRecordType type) const; bool HasEntry(RegisteredCacheEntry entry) const; - boost::optional GetEntryVersion(u64 title_id) const; + std::optional GetEntryVersion(u64 title_id) const; VirtualFile GetEntryUnparsed(u64 title_id, ContentRecordType type) const; VirtualFile GetEntryUnparsed(RegisteredCacheEntry entry) const; @@ -165,11 +163,10 @@ public: std::unique_ptr GetEntry(RegisteredCacheEntry entry) const; std::vector ListEntries() const; - // If a parameter is not boost::none, it will be filtered for from all entries. + // If a parameter is not std::nullopt, it will be filtered for from all entries. std::vector ListEntriesFilter( - boost::optional title_type = boost::none, - boost::optional record_type = boost::none, - boost::optional title_id = boost::none) const; + std::optional title_type = {}, std::optional record_type = {}, + std::optional title_id = {}) const; private: std::vector caches; -- cgit v1.2.3