| 602 | return fs::is_directory(stringToPath(vFilePathName)); |
| 603 | } |
| 604 | void GetFileDateAndSize(const std::string& vFilePathName, const IGFD::FileType& vFileType, std::string& voDate, size_t& voSize) override { |
| 605 | namespace fs = std::filesystem; |
| 606 | fs::path fpath(vFilePathName); |
| 607 | try { |
| 608 | // date |
| 609 | size_t len{}; |
| 610 | const auto lastWriteTime = fs::last_write_time(fpath); |
| 611 | const auto sctp = std::chrono::time_point_cast<std::chrono::system_clock::duration>( // |
| 612 | lastWriteTime - fs::file_time_type::clock::now() + std::chrono::system_clock::now()); |
| 613 | const auto cftime = std::chrono::system_clock::to_time_t(sctp); |
| 614 | static char timebuf[100]; |
| 615 | std::strftime(timebuf, sizeof(timebuf), DateTimeFormat, std::localtime(&cftime)); |
| 616 | voDate = timebuf; |
| 617 | // size |
| 618 | if (!vFileType.isDir()) { |
| 619 | voSize = fs::file_size(fpath); |
| 620 | } |
| 621 | } catch (const fs::filesystem_error& e) { |
| 622 | voSize = 0; |
| 623 | voDate.clear(); |
| 624 | } |
| 625 | } |
| 626 | }; |
| 627 | #define FILE_SYSTEM_OVERRIDE FileSystemStd |
| 628 | #else |
no test coverage detected