Skip to content
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

Clean up and modernize DDIO #214

Closed
wants to merge 2 commits into from

Conversation

tophyr
Copy link
Contributor

@tophyr tophyr commented Apr 28, 2024

Pull Request Type

  • GitHub Workflow changes
  • Documentation or Wiki changes
  • Build and Dependency changes
  • Runtime changes
    • Render changes
    • Audio changes
    • Input changes
    • Network changes
    • Other changes

Description

Modernize DDIO and minimize the amount of platform-specific code necessary.

  • I have tested my changes locally and verified that they work as intended.
  • I have documented any new or modified functionality.
  • I have reviewed the changes to ensure they do not introduce any unnecessary complexity or duplicate code.
  • I understand that by submitting this pull request, I am agreeing to license my contributions under the project's license.

TODO

  • windows DDIO changes
  • further cfile change propagation
  • eventually go start simply killing ddio/cfile usage where they are just wrapping std::filesystem

lib/ddio.h Outdated Show resolved Hide resolved
inline int ddio_DeleteFile(std::filesystem::path const &path) {
std::error_code ec{};
std::filesystem::remove(path, ec);
return ec ? 0 : 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I think we can change function signature here to bool ddio_DeleteFile(std::filesystem::path const &path)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha yeah, my initial goal a couple days ago was to do this very piecemeal, but have since become more aggressive with the changes

Begin replacing per-platform DDIO logic with std::filesystem.
Begin replacing custom string manipulation within CFILE with std::filesystem.
@winterheart
Copy link
Collaborator

@tophyr Let's stick with internal functions of DDIO on first run. CFILE changes a little bit intrusive to API.

@Lgt2x
Copy link
Collaborator

Lgt2x commented May 6, 2024

@tophyr Let's stick with internal functions of DDIO on first run. CFILE changes a little bit intrusive to API.

Closing for now, feel free to re-open with lighter changes!

@Lgt2x Lgt2x closed this May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants