Skip to content

[native] More std::string_view use for consistency and safety #10164

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 3 commits into from
Jun 4, 2025

Conversation

grendello
Copy link
Contributor

No description provided.

@grendello grendello requested review from Copilot and removed request for jonathanpeppers June 3, 2025 14:54
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR replaces use of raw const char* parameters with std::string_view for consistency and safety in DSO loading and file/path utilities.

  • Converted DSO loading functions and related declarations to use std::string_view
  • Updated utility functions in util.hh with new file_exists_no_null_check and a std::string_view overload
  • Added is_path_rooted helper and adjusted calls to use string_view data and size

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/native/clr/runtime-base/android-system.cc Changed DSO loader methods to accept std::string_view, updated .data() usage
src/native/clr/include/runtime-base/util.hh Added file_exists_no_null_check, file_exists(std::string_view), and is_path_rooted
src/native/clr/include/runtime-base/monodroid-dl.hh Included <string_view> and updated all const char* overloads to std::string_view
src/native/clr/include/runtime-base/android-system.hh Updated declarations to match new std::string_view signatures

@grendello
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@grendello grendello changed the title More std::string_view use for consistency and safety [native] More std::string_view use for consistency and safety Jun 3, 2025
@grendello grendello force-pushed the dev/grendel/clr-more-string_view branch from e0f4230 to d2f8ee2 Compare June 4, 2025 07:11
@grendello
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@grendello grendello merged commit f26df9e into main Jun 4, 2025
60 checks passed
@grendello grendello deleted the dev/grendel/clr-more-string_view branch June 4, 2025 09:50
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.

2 participants