diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-11-04 01:39:56 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-11-04 01:39:56 -0400 |
commit | 1f445742b4fbc185fe0e24d9ed2478e4f7495f53 (patch) | |
tree | 115717c39b7769a7ad97776fbc299362fd8b10c9 /util.cpp | |
parent | d629846220d069a86b000db213d47c8681e8f57a (diff) | |
download | abaddon-portaudio-1f445742b4fbc185fe0e24d9ed2478e4f7495f53.tar.gz abaddon-portaudio-1f445742b4fbc185fe0e24d9ed2478e4f7495f53.zip |
preserve channel list expansion and active channel (#36)
also check getenv in platform
Diffstat (limited to 'util.cpp')
-rw-r--r-- | util.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -1,4 +1,5 @@ #include "util.hpp" +#include <filesystem> Semaphore::Semaphore(int count) : m_count(count) {} @@ -200,3 +201,17 @@ void AddPointerCursor(Gtk::Widget &widget) { window->set_cursor(cursor); }); } + +bool util::IsFolder(std::string_view path) { + std::error_code ec; + const auto status = std::filesystem::status(path, ec); + if (ec) return false; + return status.type() == std::filesystem::file_type::directory; +} + +bool util::IsFile(std::string_view path) { + std::error_code ec; + const auto status = std::filesystem::status(path, ec); + if (ec) return false; + return status.type() == std::filesystem::file_type::regular; +} |