-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Re-template json_pointer on string type #3415
Re-template json_pointer on string type #3415
Conversation
0f2ad02
to
f42848f
Compare
@nlohmann Can you please take a look at the Codacy report and tell me which tool is generating that |
537c699
to
081bce9
Compare
Looks like a false positive - I ignored the issue. This should become effective in the next check. |
Okay, thanks, I would have added |
Just a thought, instead of |
We'd still need (*) I mean, we don't have to but it's nice to avoid |
83b4a65
to
6483203
Compare
Once this passes review, prior to merge, I'd just like to do one last force-push to update commit messages with the issue references. Edit: Forgot to include |
Agreed that it only makes sense if the only things are string literals and string objects, but doesn't make sense if there are true raw pointers. |
bd2b691
to
d930a86
Compare
b5d983f
to
fc3e0c0
Compare
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 discovered a few minor things in my full review. Will fix momentarily.
fc3e0c0
to
8f3b49e
Compare
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.
Ready for final review and merge.
Change exception context parameter to pointer and replace context with nullptr where appropriate.
Add variadic concat() function for concatenating char *, char, and string types.
8f3b49e
to
28ef5ee
Compare
Change json_pointer from being templated on basic_json to being templated on string type.
bebf36a
to
f5f975a
Compare
@nlohmann 3.10.6 is now 3.11.0, right? So I need to update the version numbers? |
Yes, so much has piled up. But I would have gone throw the release anyway to clean this up. |
You probably missed my comment on this closed PR: #3418 (comment) |
Not right now. |
2dcfd0c
to
fdb15f9
Compare
Version numbers updated. Mixed in some accidental edits that were supposed to go into a different branch and fixed that too. |
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.
Looks good to me.
Thanks! |
This PR changes the
json_pointer
template parameter frombasic_json
to string type and deals with unexpected complications.Most notably, a helper function for string concatenation is introduced to allow for some flexibility in the implementation of string types (and eliminate some temporaries as a positive side-effect). I'll leave it to others to remove more
std::string
API dependence (some low-hanging fruits areempty()
,find_first_of()
,substr()
).To Do:
json_pointer<basic_json>
.