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

Bug fixes and small API improvements #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zoejbare
Copy link

Bug fixes:

  • Fixed a memory leak in StringData
  • Fixed StringData not handling null C-string inputs
  • Fixed GetEmpty() returning a local when the index operator that calls it returns a reference.

API improvements:

  • Added a few functions that seemed to be missing
  • Renamed the internal string_view class to StringView so it can be supported alongside std::string_view
  • Implemented a suite of constructors and assignment operators so users can use the API as described in the readme (i.e., foo["bar"]["baz"][3] = 1.5, which wouldn't compile before)
  • Changed the behavior of the non-const string & size_t index operators so that when operating on a JSONObject of type Empty, it would be automatically converted to the Object or Array type to give users an easier option for constructing json data
  • Changed the non-const size_t index operator to automatically resize an array if the supplied index is outside the array's current range

Fixed the compiler warning about returning an address to a local when calling GetEmpty()
Added explicit support for std::string_view alongside the internal StringView type
Added a few functions it felt like the API was missing
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.

1 participant