diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-08-17 18:41:52 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-08-17 18:41:52 +0200 |
| commit | ad01db9274e982dcd63171b32eb1f5cc800b6fab (patch) | |
| tree | 73ba3f61c965856f9636b4d38b49ed2164b2680a /kapi | |
| parent | ca0c35ad7bb6e178af18f1600a7bc0da944fafb0 (diff) | |
| download | kernel-ad01db9274e982dcd63171b32eb1f5cc800b6fab.tar.xz kernel-ad01db9274e982dcd63171b32eb1f5cc800b6fab.zip | |
chore: replace expected by result
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. //! |
