diff options
| author | 2018-10-30 05:03:25 +0100 | |
|---|---|---|
| committer | 2018-10-30 00:03:25 -0400 | |
| commit | 7a5eda59146306dedaf3e6f07f97a8c6898543dd (patch) | |
| tree | 78e07b43fb0113f95e1c8e9426d3b394b9524d4e /src/core/file_sys/vfs.h | |
| parent | Merge pull request #1621 from lioncash/ipc (diff) | |
| download | yuzu-7a5eda59146306dedaf3e6f07f97a8c6898543dd.tar.gz yuzu-7a5eda59146306dedaf3e6f07f97a8c6898543dd.tar.xz yuzu-7a5eda59146306dedaf3e6f07f97a8c6898543dd.zip | |
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
Diffstat (limited to 'src/core/file_sys/vfs.h')
| -rw-r--r-- | src/core/file_sys/vfs.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/file_sys/vfs.h b/src/core/file_sys/vfs.h index 09dc9f288..002f99d4e 100644 --- a/src/core/file_sys/vfs.h +++ b/src/core/file_sys/vfs.h | |||
| @@ -4,13 +4,15 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <functional> | ||
| 7 | #include <map> | 8 | #include <map> |
| 8 | #include <memory> | 9 | #include <memory> |
| 10 | #include <optional> | ||
| 9 | #include <string> | 11 | #include <string> |
| 10 | #include <string_view> | 12 | #include <string_view> |
| 11 | #include <type_traits> | 13 | #include <type_traits> |
| 12 | #include <vector> | 14 | #include <vector> |
| 13 | #include <boost/optional.hpp> | 15 | |
| 14 | #include "common/common_types.h" | 16 | #include "common/common_types.h" |
| 15 | #include "core/file_sys/vfs_types.h" | 17 | #include "core/file_sys/vfs_types.h" |
| 16 | 18 | ||
| @@ -103,8 +105,8 @@ public: | |||
| 103 | // into file. Returns number of bytes successfully written. | 105 | // into file. Returns number of bytes successfully written. |
| 104 | virtual std::size_t Write(const u8* data, std::size_t length, std::size_t offset = 0) = 0; | 106 | virtual std::size_t Write(const u8* data, std::size_t length, std::size_t offset = 0) = 0; |
| 105 | 107 | ||
| 106 | // Reads exactly one byte at the offset provided, returning boost::none on error. | 108 | // Reads exactly one byte at the offset provided, returning std::nullopt on error. |
| 107 | virtual boost::optional<u8> ReadByte(std::size_t offset = 0) const; | 109 | virtual std::optional<u8> ReadByte(std::size_t offset = 0) const; |
| 108 | // Reads size bytes starting at offset in file into a vector. | 110 | // Reads size bytes starting at offset in file into a vector. |
| 109 | virtual std::vector<u8> ReadBytes(std::size_t size, std::size_t offset = 0) const; | 111 | virtual std::vector<u8> ReadBytes(std::size_t size, std::size_t offset = 0) const; |
| 110 | // Reads all the bytes from the file into a vector. Equivalent to 'file->Read(file->GetSize(), | 112 | // Reads all the bytes from the file into a vector. Equivalent to 'file->Read(file->GetSize(), |