diff --git a/support/include/utils/file.hpp b/support/include/utils/file.hpp index bef78ad4..b8dc2ed1 100644 --- a/support/include/utils/file.hpp +++ b/support/include/utils/file.hpp @@ -76,6 +76,9 @@ file_exists_in_path(std::wstring_view path, [[nodiscard]] auto get_free_drive_space(std::string_view path) -> std::optional; +[[nodiscard]] auto +get_free_drive_space(std::wstring_view path) -> std::optional; + [[nodiscard]] auto get_time(std::string_view path, time_type type) -> std::optional; @@ -91,6 +94,9 @@ get_times(std::wstring_view path) -> std::optional; [[nodiscard]] auto get_total_drive_space(std::string_view path) -> std::optional; +[[nodiscard]] auto +get_total_drive_space(std::wstring_view path) -> std::optional; + #if defined(PROJECT_ENABLE_LIBDSM) [[nodiscard]] auto smb_create_and_validate_relative_path(std::string_view smb_path, diff --git a/support/src/utils/file.cpp b/support/src/utils/file.cpp index 40f63710..8145a1bc 100644 --- a/support/src/utils/file.cpp +++ b/support/src/utils/file.cpp @@ -122,6 +122,11 @@ auto get_free_drive_space(std::string_view path) return std::nullopt; } +auto get_free_drive_space(std::wstring_view path) + -> std::optional { + return get_free_drive_space(utils::string::to_utf8(path)); +} + auto get_time(std::string_view path, time_type type) -> std::optional { auto times = get_times(path); @@ -252,6 +257,11 @@ auto get_total_drive_space(std::string_view path) return std::nullopt; } +auto get_total_drive_space(std::wstring_view path) + -> std::optional { + return get_total_drive_space(utils::string::to_utf8(path)); +} + auto i_fs_item::get_time(time_type type) const -> std::optional { return utils::file::get_time(get_path(), type); }