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 property-db class to record & write structured data. #397

Merged
merged 5 commits into from
May 28, 2024

Conversation

grafikrobot
Copy link
Member

Proposed changes

This adds a utility to record structured data in the form of a property database where the keys are a property path with string or number values. The data can be converted to a string, or written to a file, as JSON.

This will be used for near future recording and output of a compile database JSON file. And in the later future to produce and consume ecosystem interop information.

Types of changes

What types of changes does your code introduce?

  • New feature (non-breaking change which adds functionality)

This adds a utility to record structured data in the form of a property database where the keys are a property path with string or number values. The data can be converted to a string, or written to a file, as JSON.
@grisumbras
Copy link
Contributor

Isn't nlohmann/json MIT-licensed?

@grafikrobot
Copy link
Member Author

Isn't nlohmann/json MIT-licensed?

Yes it is. I haven't gotten around to adding a note in the docs for it.

@grisumbras
Copy link
Contributor

I feel like adding MIT code into b2 will be extremely controvercial with Boost devs. Can I convince you to use a standalone version of Boost.JSON instead?

@grafikrobot
Copy link
Member Author

@grisumbras it is my understanding, from having asked about using boost.json previously, that there is no standalone version of it any longer.

@grisumbras
Copy link
Contributor

There is still a standalone fork. But it requires C++17. But I'm sure I can create a version that works with C++11.

@grafikrobot
Copy link
Member Author

There is still a standalone fork. But it requires C++17. But I'm sure I can create a version that works with C++11.

Right.. I meant a standalone 11 version. I thought about making such changes. But never had the need or time. So if you can get such changes made I could use it instead. Even just for the plain reason that Boost.JSON is better software. I'll still go ahead with this PR though. As it's an implementation detail. And eventually I also see the need for using other non-BSL external code. So might as well think about what it means now.

@vinniefalco
Copy link

Boost.JSON is overkill if all you are doing is serializing. The only meaningful implementation work for serialization is the quoting and escaping of strings, and the conversion of double to string. We might consider creating a small, actively maintained library that only does JSON serialization, and without using the DOM (the json::value type).

@grafikrobot
Copy link
Member Author

Boost.JSON is overkill if all you are doing is serializing.

I will need read and write in what I use (even if I'm only using write ATM). Not sure what "using the DOM" means though.

@grafikrobot grafikrobot marked this pull request as ready for review May 27, 2024 19:24
@grafikrobot grafikrobot merged commit c30bce8 into main May 28, 2024
150 checks passed
@grafikrobot grafikrobot deleted the feature/json branch May 28, 2024 01:04
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