diff options
| author | Sebastian Valle <subv2112@gmail.com> | 2016-11-27 18:56:56 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-11-27 18:56:56 -0500 |
| commit | 4ba5acdaff19f5334b86e86c324763d4e9b969b0 (patch) | |
| tree | 408343a46858bcde292744d89fc6b3dadd9a54b0 /src/core/file_sys/archive_backend.h | |
| parent | 77b7cec8afcaf9c267c8dbae49e123d980a32e73 (diff) | |
| parent | 282195b450721a5b8ad0cea8e66606b2661fe888 (diff) | |
Merge pull request #2132 from wwylele/fix-fs-err
Correct FS error codes & add path boundary checks
Diffstat (limited to 'src/core/file_sys/archive_backend.h')
| -rw-r--r-- | src/core/file_sys/archive_backend.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h index 06b8f2ed7..58f6c150c 100644 --- a/src/core/file_sys/archive_backend.h +++ b/src/core/file_sys/archive_backend.h @@ -87,7 +87,7 @@ public: * @return Opened file, or error code */ virtual ResultVal<std::unique_ptr<FileBackend>> OpenFile(const Path& path, - const Mode mode) const = 0; + const Mode& mode) const = 0; /** * Delete a file specified by its path @@ -100,53 +100,53 @@ public: * Rename a File specified by its path * @param src_path Source path relative to the archive * @param dest_path Destination path relative to the archive - * @return Whether rename succeeded + * @return Result of the operation */ - virtual bool RenameFile(const Path& src_path, const Path& dest_path) const = 0; + virtual ResultCode RenameFile(const Path& src_path, const Path& dest_path) const = 0; /** * Delete a directory specified by its path * @param path Path relative to the archive - * @return Whether the directory could be deleted + * @return Result of the operation */ - virtual bool DeleteDirectory(const Path& path) const = 0; + virtual ResultCode DeleteDirectory(const Path& path) const = 0; /** * Delete a directory specified by its path and anything under it * @param path Path relative to the archive - * @return Whether the directory could be deleted + * @return Result of the operation */ - virtual bool DeleteDirectoryRecursively(const Path& path) const = 0; + virtual ResultCode DeleteDirectoryRecursively(const Path& path) const = 0; /** * Create a file specified by its path * @param path Path relative to the Archive * @param size The size of the new file, filled with zeroes - * @return File creation result code + * @return Result of the operation */ virtual ResultCode CreateFile(const Path& path, u64 size) const = 0; /** * Create a directory specified by its path * @param path Path relative to the archive - * @return Whether the directory could be created + * @return Result of the operation */ - virtual bool CreateDirectory(const Path& path) const = 0; + virtual ResultCode CreateDirectory(const Path& path) const = 0; /** * Rename a Directory specified by its path * @param src_path Source path relative to the archive * @param dest_path Destination path relative to the archive - * @return Whether rename succeeded + * @return Result of the operation */ - virtual bool RenameDirectory(const Path& src_path, const Path& dest_path) const = 0; + virtual ResultCode RenameDirectory(const Path& src_path, const Path& dest_path) const = 0; /** * Open a directory specified by its path * @param path Path relative to the archive - * @return Opened directory, or nullptr + * @return Opened directory, or error code */ - virtual std::unique_ptr<DirectoryBackend> OpenDirectory(const Path& path) const = 0; + virtual ResultVal<std::unique_ptr<DirectoryBackend>> OpenDirectory(const Path& path) const = 0; /** * Get the free space |
