parent
4958edc8b3
commit
d48d082e6b
2 changed files with 37 additions and 0 deletions
@ -0,0 +1,13 @@ |
||||
#include "file.h" |
||||
|
||||
namespace Bk::Tools { |
||||
int File::remove() |
||||
{ |
||||
return std::filesystem::remove(ent.path()); |
||||
} |
||||
|
||||
void File::copy(std::string path, CopyOption opt) |
||||
{ |
||||
if (exists()) std::filesystem::copy_file(ent.path(), path, opt); |
||||
} |
||||
} |
@ -0,0 +1,24 @@ |
||||
#pragma once |
||||
|
||||
#include <bakatoolspch.h> |
||||
#include "dir_entry.h" |
||||
|
||||
namespace Bk::Tools { |
||||
class File : public DirEntry |
||||
{ |
||||
public: |
||||
File(std::string path) |
||||
: DirEntry(path)
|
||||
{} |
||||
|
||||
File(std::filesystem::directory_entry ent) |
||||
: DirEntry(ent) {} |
||||
|
||||
virtual ~File() {} |
||||
|
||||
int remove() override; |
||||
void copy(std::string path, CopyOption opt = CopyOption::overwrite_existing) override; |
||||
|
||||
BK_DIR_ENTRY_TYPE(regular) |
||||
}; |
||||
} |
Loading…
Reference in New Issue