diff options
| author | 2020-12-10 01:31:58 -0500 | |
|---|---|---|
| committer | 2020-12-10 01:44:43 -0500 | |
| commit | b1657b8c6b4ef07dd6eea92f4559a32ca3e0894a (patch) | |
| tree | 6de62e6d506fb1867794956b52d3c2abde6054bd /src/core/file_sys/vfs.h | |
| parent | Merge pull request #5179 from ReinUsesLisp/fs-path (diff) | |
| download | yuzu-b1657b8c6b4ef07dd6eea92f4559a32ca3e0894a.tar.gz yuzu-b1657b8c6b4ef07dd6eea92f4559a32ca3e0894a.tar.xz yuzu-b1657b8c6b4ef07dd6eea92f4559a32ca3e0894a.zip | |
vfs: Use existing type aliases consistently
Makes use of the VirtualDir and VirtualFile aliases across the board
instead of having a few isolated places that don't use it.
Diffstat (limited to 'src/core/file_sys/vfs.h')
| -rw-r--r-- | src/core/file_sys/vfs.h | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/core/file_sys/vfs.h b/src/core/file_sys/vfs.h index 954094772..afd64e95c 100644 --- a/src/core/file_sys/vfs.h +++ b/src/core/file_sys/vfs.h | |||
| @@ -91,7 +91,7 @@ public: | |||
| 91 | // Resizes the file to new_size. Returns whether or not the operation was successful. | 91 | // Resizes the file to new_size. Returns whether or not the operation was successful. |
| 92 | virtual bool Resize(std::size_t new_size) = 0; | 92 | virtual bool Resize(std::size_t new_size) = 0; |
| 93 | // Gets a pointer to the directory containing this file, returning nullptr if there is none. | 93 | // Gets a pointer to the directory containing this file, returning nullptr if there is none. |
| 94 | virtual std::shared_ptr<VfsDirectory> GetContainingDirectory() const = 0; | 94 | virtual VirtualDir GetContainingDirectory() const = 0; |
| 95 | 95 | ||
| 96 | // Returns whether or not the file can be written to. | 96 | // Returns whether or not the file can be written to. |
| 97 | virtual bool IsWritable() const = 0; | 97 | virtual bool IsWritable() const = 0; |
| @@ -183,27 +183,27 @@ public: | |||
| 183 | 183 | ||
| 184 | // Retrives the file located at path as if the current directory was root. Returns nullptr if | 184 | // Retrives the file located at path as if the current directory was root. Returns nullptr if |
| 185 | // not found. | 185 | // not found. |
| 186 | virtual std::shared_ptr<VfsFile> GetFileRelative(std::string_view path) const; | 186 | virtual VirtualFile GetFileRelative(std::string_view path) const; |
| 187 | // Calls GetFileRelative(path) on the root of the current directory. | 187 | // Calls GetFileRelative(path) on the root of the current directory. |
| 188 | virtual std::shared_ptr<VfsFile> GetFileAbsolute(std::string_view path) const; | 188 | virtual VirtualFile GetFileAbsolute(std::string_view path) const; |
| 189 | 189 | ||
| 190 | // Retrives the directory located at path as if the current directory was root. Returns nullptr | 190 | // Retrives the directory located at path as if the current directory was root. Returns nullptr |
| 191 | // if not found. | 191 | // if not found. |
| 192 | virtual std::shared_ptr<VfsDirectory> GetDirectoryRelative(std::string_view path) const; | 192 | virtual VirtualDir GetDirectoryRelative(std::string_view path) const; |
| 193 | // Calls GetDirectoryRelative(path) on the root of the current directory. | 193 | // Calls GetDirectoryRelative(path) on the root of the current directory. |
| 194 | virtual std::shared_ptr<VfsDirectory> GetDirectoryAbsolute(std::string_view path) const; | 194 | virtual VirtualDir GetDirectoryAbsolute(std::string_view path) const; |
| 195 | 195 | ||
| 196 | // Returns a vector containing all of the files in this directory. | 196 | // Returns a vector containing all of the files in this directory. |
| 197 | virtual std::vector<std::shared_ptr<VfsFile>> GetFiles() const = 0; | 197 | virtual std::vector<VirtualFile> GetFiles() const = 0; |
| 198 | // Returns the file with filename matching name. Returns nullptr if directory dosen't have a | 198 | // Returns the file with filename matching name. Returns nullptr if directory dosen't have a |
| 199 | // file with name. | 199 | // file with name. |
| 200 | virtual std::shared_ptr<VfsFile> GetFile(std::string_view name) const; | 200 | virtual VirtualFile GetFile(std::string_view name) const; |
| 201 | 201 | ||
| 202 | // Returns a vector containing all of the subdirectories in this directory. | 202 | // Returns a vector containing all of the subdirectories in this directory. |
| 203 | virtual std::vector<std::shared_ptr<VfsDirectory>> GetSubdirectories() const = 0; | 203 | virtual std::vector<VirtualDir> GetSubdirectories() const = 0; |
| 204 | // Returns the directory with name matching name. Returns nullptr if directory dosen't have a | 204 | // Returns the directory with name matching name. Returns nullptr if directory dosen't have a |
| 205 | // directory with name. | 205 | // directory with name. |
| 206 | virtual std::shared_ptr<VfsDirectory> GetSubdirectory(std::string_view name) const; | 206 | virtual VirtualDir GetSubdirectory(std::string_view name) const; |
| 207 | 207 | ||
| 208 | // Returns whether or not the directory can be written to. | 208 | // Returns whether or not the directory can be written to. |
| 209 | virtual bool IsWritable() const = 0; | 209 | virtual bool IsWritable() const = 0; |
| @@ -219,31 +219,31 @@ public: | |||
| 219 | virtual std::size_t GetSize() const; | 219 | virtual std::size_t GetSize() const; |
| 220 | // Returns the parent directory of this directory. Returns nullptr if this directory is root or | 220 | // Returns the parent directory of this directory. Returns nullptr if this directory is root or |
| 221 | // has no parent. | 221 | // has no parent. |
| 222 | virtual std::shared_ptr<VfsDirectory> GetParentDirectory() const = 0; | 222 | virtual VirtualDir GetParentDirectory() const = 0; |
| 223 | 223 | ||
| 224 | // Creates a new subdirectory with name name. Returns a pointer to the new directory or nullptr | 224 | // Creates a new subdirectory with name name. Returns a pointer to the new directory or nullptr |
| 225 | // if the operation failed. | 225 | // if the operation failed. |
| 226 | virtual std::shared_ptr<VfsDirectory> CreateSubdirectory(std::string_view name) = 0; | 226 | virtual VirtualDir CreateSubdirectory(std::string_view name) = 0; |
| 227 | // Creates a new file with name name. Returns a pointer to the new file or nullptr if the | 227 | // Creates a new file with name name. Returns a pointer to the new file or nullptr if the |
| 228 | // operation failed. | 228 | // operation failed. |
| 229 | virtual std::shared_ptr<VfsFile> CreateFile(std::string_view name) = 0; | 229 | virtual VirtualFile CreateFile(std::string_view name) = 0; |
| 230 | 230 | ||
| 231 | // Creates a new file at the path relative to this directory. Also creates directories if | 231 | // Creates a new file at the path relative to this directory. Also creates directories if |
| 232 | // they do not exist and is supported by this implementation. Returns nullptr on any failure. | 232 | // they do not exist and is supported by this implementation. Returns nullptr on any failure. |
| 233 | virtual std::shared_ptr<VfsFile> CreateFileRelative(std::string_view path); | 233 | virtual VirtualFile CreateFileRelative(std::string_view path); |
| 234 | 234 | ||
| 235 | // Creates a new file at the path relative to root of this directory. Also creates directories | 235 | // Creates a new file at the path relative to root of this directory. Also creates directories |
| 236 | // if they do not exist and is supported by this implementation. Returns nullptr on any failure. | 236 | // if they do not exist and is supported by this implementation. Returns nullptr on any failure. |
| 237 | virtual std::shared_ptr<VfsFile> CreateFileAbsolute(std::string_view path); | 237 | virtual VirtualFile CreateFileAbsolute(std::string_view path); |
| 238 | 238 | ||
| 239 | // Creates a new directory at the path relative to this directory. Also creates directories if | 239 | // Creates a new directory at the path relative to this directory. Also creates directories if |
| 240 | // they do not exist and is supported by this implementation. Returns nullptr on any failure. | 240 | // they do not exist and is supported by this implementation. Returns nullptr on any failure. |
| 241 | virtual std::shared_ptr<VfsDirectory> CreateDirectoryRelative(std::string_view path); | 241 | virtual VirtualDir CreateDirectoryRelative(std::string_view path); |
| 242 | 242 | ||
| 243 | // Creates a new directory at the path relative to root of this directory. Also creates | 243 | // Creates a new directory at the path relative to root of this directory. Also creates |
| 244 | // directories if they do not exist and is supported by this implementation. Returns nullptr on | 244 | // directories if they do not exist and is supported by this implementation. Returns nullptr on |
| 245 | // any failure. | 245 | // any failure. |
| 246 | virtual std::shared_ptr<VfsDirectory> CreateDirectoryAbsolute(std::string_view path); | 246 | virtual VirtualDir CreateDirectoryAbsolute(std::string_view path); |
| 247 | 247 | ||
| 248 | // Deletes the subdirectory with the given name and returns true on success. | 248 | // Deletes the subdirectory with the given name and returns true on success. |
| 249 | virtual bool DeleteSubdirectory(std::string_view name) = 0; | 249 | virtual bool DeleteSubdirectory(std::string_view name) = 0; |
| @@ -280,12 +280,12 @@ class ReadOnlyVfsDirectory : public VfsDirectory { | |||
| 280 | public: | 280 | public: |
| 281 | bool IsWritable() const override; | 281 | bool IsWritable() const override; |
| 282 | bool IsReadable() const override; | 282 | bool IsReadable() const override; |
| 283 | std::shared_ptr<VfsDirectory> CreateSubdirectory(std::string_view name) override; | 283 | VirtualDir CreateSubdirectory(std::string_view name) override; |
| 284 | std::shared_ptr<VfsFile> CreateFile(std::string_view name) override; | 284 | VirtualFile CreateFile(std::string_view name) override; |
| 285 | std::shared_ptr<VfsFile> CreateFileAbsolute(std::string_view path) override; | 285 | VirtualFile CreateFileAbsolute(std::string_view path) override; |
| 286 | std::shared_ptr<VfsFile> CreateFileRelative(std::string_view path) override; | 286 | VirtualFile CreateFileRelative(std::string_view path) override; |
| 287 | std::shared_ptr<VfsDirectory> CreateDirectoryAbsolute(std::string_view path) override; | 287 | VirtualDir CreateDirectoryAbsolute(std::string_view path) override; |
| 288 | std::shared_ptr<VfsDirectory> CreateDirectoryRelative(std::string_view path) override; | 288 | VirtualDir CreateDirectoryRelative(std::string_view path) override; |
| 289 | bool DeleteSubdirectory(std::string_view name) override; | 289 | bool DeleteSubdirectory(std::string_view name) override; |
| 290 | bool DeleteSubdirectoryRecursive(std::string_view name) override; | 290 | bool DeleteSubdirectoryRecursive(std::string_view name) override; |
| 291 | bool CleanSubdirectoryRecursive(std::string_view name) override; | 291 | bool CleanSubdirectoryRecursive(std::string_view name) override; |