diff options
Diffstat (limited to 'kapi')
| -rw-r--r-- | kapi/kapi/filesystem.hpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/kapi/kapi/filesystem.hpp b/kapi/kapi/filesystem.hpp index da72f523..956dc116 100644 --- a/kapi/kapi/filesystem.hpp +++ b/kapi/kapi/filesystem.hpp @@ -13,7 +13,6 @@ #include <kstd/units.hpp> #include <cstddef> -#include <expected> #include <span> #include <string_view> @@ -33,40 +32,39 @@ namespace kapi::filesystem //! @param source The source device or filesystem to mount. //! @param target The target mount point. //! @return Nothing on success, an error code otherwise. - auto mount(std::string_view source, std::string_view target) -> std::expected<void, kstd::error_code>; + auto mount(std::string_view source, std::string_view target) -> kstd::result<void>; //! Unmount a filesystem from the specified target path. //! //! @param target The target mount point to unmount. //! @return Nothing on success, an error code otherwise. - auto umount(std::string_view target) -> std::expected<void, kstd::error_code>; + auto umount(std::string_view target) -> kstd::result<void>; //! Open a file at the specified path. //! //! @param path The path to the file to open. //! @return A file descriptor on success, an error code otherwise. - auto open(std::string_view path) -> std::expected<std::size_t, kstd::error_code>; + auto open(std::string_view path) -> kstd::result<std::size_t>; //! Close a file descriptor. //! //! @param file_descriptor The file descriptor to close. //! @return Nothing on success, an error code otherwise . - auto close(size_t file_descriptor) -> std::expected<void, kstd::error_code>; + auto close(size_t file_descriptor) -> kstd::result<void>; //! Read bytes from a file into a given buffer. //! //! @param file_descriptor The file descriptor to read from. //! @param buffer The buffer to store the read data. //! @return The number of bytes read on success, an error code otherwise. - auto read(size_t file_descriptor, std::span<std::byte> buffer) -> std::expected<kstd::units::bytes, kstd::error_code>; + auto read(size_t file_descriptor, std::span<std::byte> buffer) -> kstd::result<kstd::units::bytes>; //! Write bytes from a given buffer to a file descriptor. //! //! @param file_descriptor The file descriptor to write to. //! @param buffer The buffer containing the data to write. //! @return The number of bytes written on success, an error code otherwise. - auto write(size_t file_descriptor, std::span<std::byte const> buffer) - -> std::expected<kstd::units::bytes, kstd::error_code>; + auto write(size_t file_descriptor, std::span<std::byte const> buffer) -> kstd::result<kstd::units::bytes>; //! Create a new directory at the specified path. //! |
