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 that std::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 with std::filesystem::file_time_type for image and data lists. This is a much more efficient way to get the modified time of a file.
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.