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

add a valueToQuotedString overload #1397

Merged
merged 3 commits into from
Sep 10, 2024

Conversation

phlptp
Copy link
Contributor

@phlptp phlptp commented Mar 23, 2022

to take a string length to support things like a string_view more directly.

The valueToQuotedString method is useful for a few other items related to JSON generation. In many cases we had to use it directly from a std::string_view, which in the present code required conversion to a string, then using the c_str and it computing the length. So this PR adds an overload that allows direct specification of the string length. and a few places in the code that could take advantage of it.

src/lib_json/json_writer.cpp Outdated Show resolved Hide resolved
src/lib_json/json_writer.cpp Outdated Show resolved Hide resolved
Co-authored-by: Billy Donahue <BillyDonahue@users.noreply.github.com>
Copy link
Contributor

@BillyDonahue BillyDonahue left a comment

Choose a reason for hiding this comment

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

This looks fine to me. It doesn't break backward compatibility AFAICT.

@baylesj baylesj merged commit 034976a into open-source-parsers:master Sep 10, 2024
6 checks passed
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.

3 participants