chipsenkbeil / typed-path

Provides typed variants of Path and PathBuf for Unix and Windows
39 stars 7 forks source link

Support UTF-8 paths similar to camino #4

Closed chipsenkbeil closed 1 year ago

chipsenkbeil commented 2 years ago

Right now, the Path<T> and PathBuf<T> types use raw [u8] and Vec<u8> underneath. It would be nice to have Utf8Path<T> and Utf8PathBuf<T> that use str and String as an alternative.

The encoding and parsing logic would work without needing any changes since we can get the bytes for the str and String. It would mean adding another entire copy of the structs and enums for Iter, Ancestors, Display, Path, and PathBuf. Will also need custom versions for WindowsPrefix and WindowsPrefixComponent.

chipsenkbeil commented 2 years ago

And we'd need Utf8 versions of WindowsComponent, WindowsComponents, UnixComponent, and UnixComponents.

chipsenkbeil commented 2 years ago

Nearly done. The implementations and majority of tests are committed, but some additional conversions need to be added.

chipsenkbeil commented 1 year ago

It's been awhile since I've touched this library and I cannot remember what else needed to be done with the conversion logic. So for now I'm going to publish the v0.2 release and additions can be made as needed.

chipsenkbeil commented 1 year ago

Resolved by https://github.com/chipsenkbeil/typed-path/commit/b220ec91d452afb4b11876fb68e6929be1169e55.