KeyWorksRW / wxUiEditor

RAD tool used to create and maintain wxWidgets UI elements.
Apache License 2.0
61 stars 6 forks source link

Update tt_string's use of std::filesystem, update Image/Data list file modification tracking #1421

Closed Randalphwa closed 5 months ago

Randalphwa commented 5 months ago

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:

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.