modified DirEntry

main
anulax1225 ago%!(EXTRA string=1 year)
parent 0c7239f21b
commit e33c54fbeb
  1. 7
      src/bakatools/file_system/dir_entry.cpp
  2. 5
      src/bakatools/file_system/dir_entry.h

@ -1,6 +1,7 @@
#include "dir_entry.h" #include "dir_entry.h"
namespace Bk { namespace Bk
{
std::string DirEntry::path() std::string DirEntry::path()
{ {
return this->ent.path().string(); return this->ent.path().string();
@ -26,9 +27,9 @@ namespace Bk {
return ent.file_size(); return ent.file_size();
} }
TimePoint<Bk::FileClock, Bk::Second> DirEntry::last_write() Bk::TimePoint<Bk::FileClock, Bk::Second> DirEntry::last_write()
{ {
return TimePoint<Bk::FileClock, Bk::Second>(ent.last_write_time()); return Bk::TimePoint<Bk::FileClock, Bk::Second>(ent.last_write_time());
} }
bool DirEntry::exists() bool DirEntry::exists()

@ -6,7 +6,8 @@
#define BK_DIR_ENTRY_TYPE(type) const char* type_name() override { return BK_STRINGIFY(type); }\ #define BK_DIR_ENTRY_TYPE(type) const char* type_name() override { return BK_STRINGIFY(type); }\
static FileType get_type() { return FileType::type; }\ static FileType get_type() { return FileType::type; }\
namespace Bk { namespace Bk
{
using FileType = std::filesystem::file_type; using FileType = std::filesystem::file_type;
using FilePerms = std::filesystem::perms; using FilePerms = std::filesystem::perms;
using FileStatus = std::filesystem::file_status; using FileStatus = std::filesystem::file_status;
@ -32,7 +33,7 @@ namespace Bk {
std::string name(); std::string name();
uintmax_t size(); uintmax_t size();
TimePoint<Bk::FileClock, Bk::Second> last_write(); Bk::TimePoint<Bk::FileClock, Bk::Second> last_write();
bool exists(); bool exists();
FilePerms perms(); FilePerms perms();
uintmax_t hard_links(); uintmax_t hard_links();

Loading…
Cancel
Save