-
Notifications
You must be signed in to change notification settings - Fork 493
use std::filesystem::path for filesystem operations
#5356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Recode most uses of `std::string` to represent a path name to use `std::filesystem::path` instead. Eliminate most of old crunchy filesystem module with `std::filesystem` equivalent methods some modules have also cleaned to remove `using filesystem std` and/or missing or unnecessary `#include`s note: the `atime`, `ctime`, and `filetype` methods of the `Filesystem` module have been removed because they're POSIX-specific, not supported by `std::filesystem`, and unused in DFHack
really wish we could use `std::format`
Member
Author
|
it would appear that i need to rewrite the tests for |
and use in tests instead of hacky regexp
also make testing slightly noisier
myk002
approved these changes
Mar 22, 2025
| return; | ||
|
|
||
| std::string rawFolder = !isWorldLoaded() ? "" : "save/" + World::ReadWorldFolder() + "/init"; | ||
| std::filesystem::path rawFolder = !isWorldLoaded() ? std::filesystem::path{} : std::filesystem::path{} / "save" / World::ReadWorldFolder() / "init"; |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this path is deprecated, but we can address that in another PR
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Recode most uses of
std::stringto represent a path name to usestd::filesystem::pathinstead. Replace most of old crunchy filesystem module withstd::filesystemequivalentsSome modules have also cleaned to address
using filesystem stdand/or missing or unnecessary#includesThe
atime,ctime, andfiletypemethods of theFilesystemmodule have been removed because they're POSIX-specific, not supported bystd::filesystem, and unused in DFHack