mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-29 17:17:28 -04:00
Fileman icon toolbar (#975)
* Add cut/copy/paste menu with icons * Add icons, file limit to fileman
This commit is contained in:
parent
f9fdeb3419
commit
a832bd433d
16 changed files with 306 additions and 63 deletions
|
@ -197,18 +197,21 @@ std::vector<std::filesystem::path> scan_root_directories(const std::filesystem::
|
|||
return directory_list;
|
||||
}
|
||||
|
||||
uint32_t delete_file(const std::filesystem::path& file_path) {
|
||||
return f_unlink(reinterpret_cast<const TCHAR*>(file_path.c_str()));
|
||||
std::filesystem::filesystem_error delete_file(const std::filesystem::path& file_path) {
|
||||
return { f_unlink(reinterpret_cast<const TCHAR*>(file_path.c_str())) };
|
||||
}
|
||||
|
||||
uint32_t rename_file(const std::filesystem::path& file_path, const std::filesystem::path& new_name) {
|
||||
return f_rename(reinterpret_cast<const TCHAR*>(file_path.c_str()), reinterpret_cast<const TCHAR*>(new_name.c_str()));
|
||||
std::filesystem::filesystem_error rename_file(
|
||||
const std::filesystem::path& file_path,
|
||||
const std::filesystem::path& new_name
|
||||
) {
|
||||
return { f_rename(reinterpret_cast<const TCHAR*>(file_path.c_str()), reinterpret_cast<const TCHAR*>(new_name.c_str())) };
|
||||
}
|
||||
|
||||
std::filesystem::filesystem_error copy_file(
|
||||
const std::filesystem::path& file_path,
|
||||
const std::filesystem::path& dest_path)
|
||||
{
|
||||
const std::filesystem::path& dest_path
|
||||
) {
|
||||
File src;
|
||||
File dst;
|
||||
constexpr size_t buffer_size = 512;
|
||||
|
@ -242,8 +245,20 @@ FATTimestamp file_created_date(const std::filesystem::path& file_path) {
|
|||
return { filinfo.fdate, filinfo.ftime };
|
||||
}
|
||||
|
||||
uint32_t make_new_directory(const std::filesystem::path& dir_path) {
|
||||
return f_mkdir(reinterpret_cast<const TCHAR*>(dir_path.c_str()));
|
||||
std::filesystem::filesystem_error make_new_file(
|
||||
const std::filesystem::path& file_path
|
||||
) {
|
||||
File f;
|
||||
auto result = f.create(file_path);
|
||||
return result.is_valid()
|
||||
? result.value()
|
||||
: std::filesystem::filesystem_error{ };
|
||||
}
|
||||
|
||||
std::filesystem::filesystem_error make_new_directory(
|
||||
const std::filesystem::path& dir_path
|
||||
) {
|
||||
return { f_mkdir(reinterpret_cast<const TCHAR*>(dir_path.c_str())) };
|
||||
}
|
||||
|
||||
namespace std {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue