Update tt_string's use of std::filesystem, update Image/Data list file modification tracking #1421
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR has two parts. The first is an overhaul of tt_string's use of std::filesystem. A
CHAR8_T_CAST
macro is now used to cast a std::string.cstr() to either(char const*)
for C++17 or(char8_t const*)
for C++20 and beyond. This ensures thatstd::filesystem::path()
will correctly convert all UTF-8 encoded strings to the correct path on all platforms.A new tt_string::assign_path() method is added which supports converting a std::filesystem::path to a tt_string that works on all platforms. This eliminates the need for the
_WIN32
conditionals that were used in other methods dealing with conversion from a path to a string.New methods:
std::filesystem::path make_path()
std::uintmax_t file_size()
The second part replaces
wxDateTime
withstd::filesystem::file_time_type
for image and data lists. This is a much more efficient way to get the modified time of a file.