-
Notifications
You must be signed in to change notification settings - Fork 69
Refactor JSON Parsing to Use Boost.JSON #197
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
Conversation
14cee0e to
9ea9ef9
Compare
|
|
||
| const boost::json::array& providers = source.at("providers").as_array(); | ||
| for (const auto& provider : providers) { | ||
| std::string providerName = provider.as_object().at("providerName").as_string().c_str(); |
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.
qq: btw, what happens when someone mixes the cases the names eg. ProviderName instead of providerName?
|
|
||
| // Process channels if they exist | ||
| if (source.as_object().contains("channels")) { | ||
| std::vector<EventLogChannel>* channels = new std::vector<EventLogChannel>(); |
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.
Could we avoid dynamic memory memory management because of memory leaks?
https://learnmoderncpp.com/2024/08/05/memory-allocation-techniques-in-modern-c/
| ) | ||
| ); | ||
|
|
||
| std::shared_ptr<SourceProcess> sourceProcess = std::make_shared< SourceProcess>(); |
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.
std::unique_ptr perhaps since ownership is not shared?
Signed-off-by: Charity Kathure <ckathure@microsoft.com>
fc1ddfa to
433d70c
Compare
Signed-off-by: Charity Kathure <ckathure@microsoft.com>
Signed-off-by: Charity Kathure <ckathure@microsoft.com>
|
Closing this PR to open a new one targeting a branch specifically for version 2.2.0rc.: #202 |
Description
This PR refactors the JSON file parsing logic in the codebase, replacing custom parsers with the more robust and efficient Boost.JSON library. The switch to Boost.JSON simplifies the code by leveraging a well-maintained and high-performance library, improving maintainability, readability, and performance.
STDOUT after change:
