header_utils
Loading...
Searching...
No Matches
Filesystem Expected

The functions in this module mirror those in <filesystem>, except they return an expected<result_type, error_code> instead of throwing or taking an error_code&. More...

Functions

auto ghassanpl::fs::absolute (const stdfs::path &path) -> expected< stdfs::path, std::error_code >
auto ghassanpl::fs::canonical (const stdfs::path &path) -> expected< stdfs::path, std::error_code >
auto ghassanpl::fs::weakly_canonical (const stdfs::path &path) -> expected< stdfs::path, std::error_code >
auto ghassanpl::fs::relative (const stdfs::path &p) -> expected< stdfs::path, std::error_code >
auto ghassanpl::fs::relative (const stdfs::path &p, const stdfs::path &base) -> expected< stdfs::path, std::error_code >
auto ghassanpl::fs::proximate (const stdfs::path &p) -> expected< stdfs::path, std::error_code >
auto ghassanpl::fs::proximate (const stdfs::path &p, const stdfs::path &base) -> expected< stdfs::path, std::error_code >
auto ghassanpl::fs::copy (const stdfs::path &from, const stdfs::path &to) -> expected< void, std::error_code >
auto ghassanpl::fs::copy (const stdfs::path &from, const stdfs::path &to, stdfs::copy_options options) -> expected< void, std::error_code >
auto ghassanpl::fs::copy_file (const stdfs::path &from, const stdfs::path &to) -> expected< uintmax_t, std::error_code >
auto ghassanpl::fs::copy_file (const stdfs::path &from, const stdfs::path &to, stdfs::copy_options options) -> expected< uintmax_t, std::error_code >
auto ghassanpl::fs::copy_symlink (const stdfs::path &from, const stdfs::path &to) -> expected< void, std::error_code >
auto ghassanpl::fs::create_directory (const stdfs::path &p) -> expected< bool, std::error_code >
auto ghassanpl::fs::create_directory (const stdfs::path &p, const stdfs::path &existing_p) -> expected< bool, std::error_code >
auto ghassanpl::fs::create_directories (const stdfs::path &p) -> expected< bool, std::error_code >
auto ghassanpl::fs::create_hard_link (const stdfs::path &target, const stdfs::path &link) -> expected< void, std::error_code >
auto ghassanpl::fs::create_symlink (const stdfs::path &target, const stdfs::path &link) -> expected< void, std::error_code >
auto ghassanpl::fs::create_directory_symlink (const stdfs::path &target, const stdfs::path &link) -> expected< void, std::error_code >
auto ghassanpl::fs::current_path () -> expected< stdfs::path, std::error_code >
auto ghassanpl::fs::current_path (const stdfs::path &p) -> expected< void, std::error_code >
auto ghassanpl::fs::exists (stdfs::file_status s) noexcept
auto ghassanpl::fs::exists (const stdfs::path &p) -> expected< bool, std::error_code >
auto ghassanpl::fs::equivalent (const stdfs::path &p1, const stdfs::path &p2) -> expected< bool, std::error_code >
auto ghassanpl::fs::file_size (const stdfs::path &p) -> expected< uintmax_t, std::error_code >
auto ghassanpl::fs::hard_link_count (const stdfs::path &p) -> expected< uintmax_t, std::error_code >
auto ghassanpl::fs::last_write_time (const stdfs::path &path) -> expected< stdfs::file_time_type, std::error_code >
auto ghassanpl::fs::last_write_time (const stdfs::path &path, stdfs::file_time_type new_time) -> expected< void, std::error_code >
auto ghassanpl::fs::permissions (const stdfs::path &p, stdfs::perms prms) -> expected< void, std::error_code >
auto ghassanpl::fs::permissions (const stdfs::path &p, stdfs::perms prms, stdfs::perm_options opts) -> expected< void, std::error_code >
auto ghassanpl::fs::read_symlink (const stdfs::path &p) -> expected< stdfs::path, std::error_code >
auto ghassanpl::fs::remove (const stdfs::path &p) -> expected< bool, std::error_code >
auto ghassanpl::fs::remove_all (const stdfs::path &p) -> expected< uintmax_t, std::error_code >
auto ghassanpl::fs::rename (const stdfs::path &from, const stdfs::path &to) -> expected< void, std::error_code >
auto ghassanpl::fs::resize_file (const stdfs::path &p, uintmax_t size) -> expected< void, std::error_code >
auto ghassanpl::fs::space (const stdfs::path &p) -> expected< stdfs::space_info, std::error_code >
auto ghassanpl::fs::status (const stdfs::path &p) -> expected< stdfs::file_status, std::error_code >
auto ghassanpl::fs::status_known (stdfs::file_status s) noexcept
auto ghassanpl::fs::symlink_status (const stdfs::path &p) -> expected< stdfs::file_status, std::error_code >
auto ghassanpl::fs::temp_directory_path () -> expected< stdfs::path, std::error_code >
auto ghassanpl::fs::is_block_file (stdfs::file_status s) noexcept
auto ghassanpl::fs::is_character_file (stdfs::file_status s) noexcept
auto ghassanpl::fs::is_directory (stdfs::file_status s) noexcept
auto ghassanpl::fs::is_fifo (stdfs::file_status s) noexcept
auto ghassanpl::fs::is_other (stdfs::file_status s) noexcept
auto ghassanpl::fs::is_regular_file (stdfs::file_status s) noexcept
auto ghassanpl::fs::is_socket (stdfs::file_status s) noexcept
auto ghassanpl::fs::is_symlink (stdfs::file_status s) noexcept
auto ghassanpl::fs::is_block_file (const stdfs::path &p) -> expected< bool, std::error_code >
auto ghassanpl::fs::is_character_file (const stdfs::path &p) -> expected< bool, std::error_code >
auto ghassanpl::fs::is_directory (const stdfs::path &p) -> expected< bool, std::error_code >
auto ghassanpl::fs::is_empty (const stdfs::path &p) -> expected< bool, std::error_code >
auto ghassanpl::fs::is_fifo (const stdfs::path &p) -> expected< bool, std::error_code >
auto ghassanpl::fs::is_other (const stdfs::path &p) -> expected< bool, std::error_code >
auto ghassanpl::fs::is_regular_file (const stdfs::path &p) -> expected< bool, std::error_code >
auto ghassanpl::fs::is_socket (const stdfs::path &p) -> expected< bool, std::error_code >
auto ghassanpl::fs::is_symlink (const stdfs::path &p) -> expected< bool, std::error_code >

Detailed Description

The functions in this module mirror those in <filesystem>, except they return an expected<result_type, error_code> instead of throwing or taking an error_code&.

Function Documentation

◆ absolute()

auto ghassanpl::fs::absolute ( const stdfs::path & path) -> expected< stdfs::path, std::error_code >
inlinenodiscard

Definition at line 30 of file filesystem.h.

◆ canonical()

auto ghassanpl::fs::canonical ( const stdfs::path & path) -> expected< stdfs::path, std::error_code >
inlinenodiscard

Definition at line 31 of file filesystem.h.

◆ copy() [1/2]

auto ghassanpl::fs::copy ( const stdfs::path & from,
const stdfs::path & to ) -> expected< void, std::error_code >
inline

Definition at line 37 of file filesystem.h.

◆ copy() [2/2]

auto ghassanpl::fs::copy ( const stdfs::path & from,
const stdfs::path & to,
stdfs::copy_options options ) -> expected< void, std::error_code >
inline

Definition at line 38 of file filesystem.h.

◆ copy_file() [1/2]

auto ghassanpl::fs::copy_file ( const stdfs::path & from,
const stdfs::path & to ) -> expected< uintmax_t, std::error_code >
inline

Definition at line 39 of file filesystem.h.

◆ copy_file() [2/2]

auto ghassanpl::fs::copy_file ( const stdfs::path & from,
const stdfs::path & to,
stdfs::copy_options options ) -> expected< uintmax_t, std::error_code >
inline

Definition at line 40 of file filesystem.h.

◆ copy_symlink()

auto ghassanpl::fs::copy_symlink ( const stdfs::path & from,
const stdfs::path & to ) -> expected< void, std::error_code >
inline

Definition at line 41 of file filesystem.h.

◆ create_directories()

auto ghassanpl::fs::create_directories ( const stdfs::path & p) -> expected< bool, std::error_code >
inline

Definition at line 44 of file filesystem.h.

◆ create_directory() [1/2]

auto ghassanpl::fs::create_directory ( const stdfs::path & p) -> expected< bool, std::error_code >
inline

Definition at line 42 of file filesystem.h.

◆ create_directory() [2/2]

auto ghassanpl::fs::create_directory ( const stdfs::path & p,
const stdfs::path & existing_p ) -> expected< bool, std::error_code >
inline

Definition at line 43 of file filesystem.h.

◆ create_directory_symlink()

auto ghassanpl::fs::create_directory_symlink ( const stdfs::path & target,
const stdfs::path & link ) -> expected< void, std::error_code >
inline

Definition at line 47 of file filesystem.h.

◆ create_hard_link()

auto ghassanpl::fs::create_hard_link ( const stdfs::path & target,
const stdfs::path & link ) -> expected< void, std::error_code >
inline

Definition at line 45 of file filesystem.h.

◆ create_symlink()

auto ghassanpl::fs::create_symlink ( const stdfs::path & target,
const stdfs::path & link ) -> expected< void, std::error_code >
inline

Definition at line 46 of file filesystem.h.

◆ current_path() [1/2]

auto ghassanpl::fs::current_path ( ) -> expected< stdfs::path, std::error_code >
inlinenodiscard

Definition at line 48 of file filesystem.h.

◆ current_path() [2/2]

auto ghassanpl::fs::current_path ( const stdfs::path & p) -> expected< void, std::error_code >
inline

Definition at line 49 of file filesystem.h.

◆ equivalent()

auto ghassanpl::fs::equivalent ( const stdfs::path & p1,
const stdfs::path & p2 ) -> expected< bool, std::error_code >
inlinenodiscard

Definition at line 52 of file filesystem.h.

◆ exists() [1/2]

auto ghassanpl::fs::exists ( const stdfs::path & p) -> expected< bool, std::error_code >
inlinenodiscard

Definition at line 51 of file filesystem.h.

◆ exists() [2/2]

auto ghassanpl::fs::exists ( stdfs::file_status s)
inlinenodiscardnoexcept

Definition at line 50 of file filesystem.h.

◆ file_size()

auto ghassanpl::fs::file_size ( const stdfs::path & p) -> expected< uintmax_t, std::error_code >
inlinenodiscard

Definition at line 53 of file filesystem.h.

◆ hard_link_count()

auto ghassanpl::fs::hard_link_count ( const stdfs::path & p) -> expected< uintmax_t, std::error_code >
inlinenodiscard

Definition at line 54 of file filesystem.h.

◆ is_block_file() [1/2]

auto ghassanpl::fs::is_block_file ( const stdfs::path & p) -> expected< bool, std::error_code >
inlinenodiscard

Definition at line 79 of file filesystem.h.

◆ is_block_file() [2/2]

auto ghassanpl::fs::is_block_file ( stdfs::file_status s)
inlinenodiscardnoexcept

Definition at line 70 of file filesystem.h.

◆ is_character_file() [1/2]

auto ghassanpl::fs::is_character_file ( const stdfs::path & p) -> expected< bool, std::error_code >
inlinenodiscard

Definition at line 80 of file filesystem.h.

◆ is_character_file() [2/2]

auto ghassanpl::fs::is_character_file ( stdfs::file_status s)
inlinenodiscardnoexcept

Definition at line 71 of file filesystem.h.

◆ is_directory() [1/2]

auto ghassanpl::fs::is_directory ( const stdfs::path & p) -> expected< bool, std::error_code >
inlinenodiscard

Definition at line 81 of file filesystem.h.

◆ is_directory() [2/2]

auto ghassanpl::fs::is_directory ( stdfs::file_status s)
inlinenodiscardnoexcept

Definition at line 72 of file filesystem.h.

◆ is_empty()

auto ghassanpl::fs::is_empty ( const stdfs::path & p) -> expected< bool, std::error_code >
inlinenodiscard

Definition at line 82 of file filesystem.h.

◆ is_fifo() [1/2]

auto ghassanpl::fs::is_fifo ( const stdfs::path & p) -> expected< bool, std::error_code >
inlinenodiscard

Definition at line 83 of file filesystem.h.

◆ is_fifo() [2/2]

auto ghassanpl::fs::is_fifo ( stdfs::file_status s)
inlinenodiscardnoexcept

Definition at line 73 of file filesystem.h.

◆ is_other() [1/2]

auto ghassanpl::fs::is_other ( const stdfs::path & p) -> expected< bool, std::error_code >
inlinenodiscard

Definition at line 84 of file filesystem.h.

◆ is_other() [2/2]

auto ghassanpl::fs::is_other ( stdfs::file_status s)
inlinenodiscardnoexcept

Definition at line 74 of file filesystem.h.

◆ is_regular_file() [1/2]

auto ghassanpl::fs::is_regular_file ( const stdfs::path & p) -> expected< bool, std::error_code >
inlinenodiscard

Definition at line 85 of file filesystem.h.

◆ is_regular_file() [2/2]

auto ghassanpl::fs::is_regular_file ( stdfs::file_status s)
inlinenodiscardnoexcept

Definition at line 75 of file filesystem.h.

◆ is_socket() [1/2]

auto ghassanpl::fs::is_socket ( const stdfs::path & p) -> expected< bool, std::error_code >
inlinenodiscard

Definition at line 86 of file filesystem.h.

◆ is_socket() [2/2]

auto ghassanpl::fs::is_socket ( stdfs::file_status s)
inlinenodiscardnoexcept

Definition at line 76 of file filesystem.h.

◆ is_symlink() [1/2]

auto ghassanpl::fs::is_symlink ( const stdfs::path & p) -> expected< bool, std::error_code >
inlinenodiscard

Definition at line 87 of file filesystem.h.

◆ is_symlink() [2/2]

auto ghassanpl::fs::is_symlink ( stdfs::file_status s)
inlinenodiscardnoexcept

Definition at line 77 of file filesystem.h.

◆ last_write_time() [1/2]

auto ghassanpl::fs::last_write_time ( const stdfs::path & path) -> expected< stdfs::file_time_type, std::error_code >
inlinenodiscard

Definition at line 55 of file filesystem.h.

◆ last_write_time() [2/2]

auto ghassanpl::fs::last_write_time ( const stdfs::path & path,
stdfs::file_time_type new_time ) -> expected< void, std::error_code >
inline

Definition at line 56 of file filesystem.h.

◆ permissions() [1/2]

auto ghassanpl::fs::permissions ( const stdfs::path & p,
stdfs::perms prms ) -> expected< void, std::error_code >
inlinenodiscard

Definition at line 57 of file filesystem.h.

◆ permissions() [2/2]

auto ghassanpl::fs::permissions ( const stdfs::path & p,
stdfs::perms prms,
stdfs::perm_options opts ) -> expected< void, std::error_code >
inline

Definition at line 58 of file filesystem.h.

◆ proximate() [1/2]

auto ghassanpl::fs::proximate ( const stdfs::path & p) -> expected< stdfs::path, std::error_code >
inlinenodiscard

Definition at line 35 of file filesystem.h.

◆ proximate() [2/2]

auto ghassanpl::fs::proximate ( const stdfs::path & p,
const stdfs::path & base ) -> expected< stdfs::path, std::error_code >
inlinenodiscard

Definition at line 36 of file filesystem.h.

◆ read_symlink()

auto ghassanpl::fs::read_symlink ( const stdfs::path & p) -> expected< stdfs::path, std::error_code >
inlinenodiscard

Definition at line 59 of file filesystem.h.

◆ relative() [1/2]

auto ghassanpl::fs::relative ( const stdfs::path & p) -> expected< stdfs::path, std::error_code >
inlinenodiscard

Definition at line 33 of file filesystem.h.

◆ relative() [2/2]

auto ghassanpl::fs::relative ( const stdfs::path & p,
const stdfs::path & base ) -> expected< stdfs::path, std::error_code >
inlinenodiscard

Definition at line 34 of file filesystem.h.

◆ remove()

auto ghassanpl::fs::remove ( const stdfs::path & p) -> expected< bool, std::error_code >
inline

Definition at line 60 of file filesystem.h.

◆ remove_all()

auto ghassanpl::fs::remove_all ( const stdfs::path & p) -> expected< uintmax_t, std::error_code >
inline

Definition at line 61 of file filesystem.h.

◆ rename()

auto ghassanpl::fs::rename ( const stdfs::path & from,
const stdfs::path & to ) -> expected< void, std::error_code >
inline

Definition at line 62 of file filesystem.h.

◆ resize_file()

auto ghassanpl::fs::resize_file ( const stdfs::path & p,
uintmax_t size ) -> expected< void, std::error_code >
inline

Definition at line 63 of file filesystem.h.

◆ space()

auto ghassanpl::fs::space ( const stdfs::path & p) -> expected< stdfs::space_info, std::error_code >
inlinenodiscard

Definition at line 64 of file filesystem.h.

◆ status()

auto ghassanpl::fs::status ( const stdfs::path & p) -> expected< stdfs::file_status, std::error_code >
inlinenodiscard

Definition at line 65 of file filesystem.h.

◆ status_known()

auto ghassanpl::fs::status_known ( stdfs::file_status s)
inlinenodiscardnoexcept

Definition at line 66 of file filesystem.h.

◆ symlink_status()

auto ghassanpl::fs::symlink_status ( const stdfs::path & p) -> expected< stdfs::file_status, std::error_code >
inlinenodiscard

Definition at line 67 of file filesystem.h.

◆ temp_directory_path()

auto ghassanpl::fs::temp_directory_path ( ) -> expected< stdfs::path, std::error_code >
inlinenodiscard

Definition at line 68 of file filesystem.h.

◆ weakly_canonical()

auto ghassanpl::fs::weakly_canonical ( const stdfs::path & path) -> expected< stdfs::path, std::error_code >
inlinenodiscard

Definition at line 32 of file filesystem.h.