mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-13 20:18:50 +03:00
preserve channel list expansion and active channel (#36)
also check getenv in platform
This commit is contained in:
15
util.cpp
15
util.cpp
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user