Commit Graph

5 Commits (b3a549b8b5e01809b2dd2006d6bf92a7a4d6baf7)

Author SHA1 Message Date
Andrey Lihatskiy ddbe1ff981 Fix xcode16 build errors 2025-02-13 17:30:08 +02:00
Nat Goodspeed be40936881 trailing spaces from other branches 2024-09-19 12:40:56 -04:00
Nat Goodspeed 725e1b7d6f Ditch trailing space. 2024-09-18 16:56:10 -04:00
Nat Goodspeed 837a6e04d8 Give our fsyspath an operator std::string() conversion method.
This is redundant (but harmless) on a Posix system, but it fills a missing
puzzle piece on Windows. The point of fsyspath is to be able to interchange
freely between fsyspath and std::string. Existing fsyspath could be
constructed and assigned from std::string, and we could explicitly call its
string() method to get a std::string, but an implicit fsyspath-to-string
conversion that worked on Posix would trip us up on Windows. Fix that.

(cherry picked from commit fbeff6d8052d4b614a0a2c8ebaf35b45379ab578)
2024-09-18 16:52:45 -04:00
Nat Goodspeed e829828dcd Introduce fsyspath subclass of std::filesystem::path.
Our std::strings are UTF-8 encoded, so conversion from std::string to
std::filesystem::path must use UTF-8 decoding. The native Windows
std::filesystem::path constructor and assignment operator accepting
std::string use "native narrow encoding," which mangles path strings
containing UTF-8 encoded non-ASCII characters.

fsyspath's std::string constructor and assignment operator explicitly engage
std::filesystem::u8path() to handle encoding. u8path() is deprecated in C++20,
but once we adapt fsyspath's conversion to C++20 conventions, consuming code
need not be modified.

(cherry picked from commit e399b02e3306a249cb161f07cac578d3f2617bab)
2024-09-18 16:52:08 -04:00