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

Several xml parser improvements #279

Merged

Conversation

cniethammer
Copy link
Contributor

@cniethammer cniethammer commented Nov 16, 2023

Description

Improvements to the xml parser for boolean values.

  • Make parsing boolean values by the XML parser case-insensitive
  • Parser interprets now "true", "on", "yes", and "1" as true and "false", "off", "no", and "0" as false, while reporting everything else as an error.
  • Refactor and generalize code using type traits instead of template specialization

Related Pull Requests

Resolved Issues

(None)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

  • Running DropletCoalescing example and verifying that passing different values for "output/outputplugin@enable works as expected.

HomesGH and others added 3 commits November 16, 2023 14:05
Make checking for non negative numbers in tags robust against white spaces.

Signed-off-by: Christoph Niethammer <[email protected]>
@cniethammer cniethammer changed the title Feature xml bool parsing improvements Severa xml bool parsing improvements Nov 16, 2023
@cniethammer cniethammer requested a review from HomesGH November 16, 2023 13:41
@cniethammer cniethammer added the enhancement New feature or request label Nov 16, 2023
@HomesGH HomesGH changed the title Severa xml bool parsing improvements Several xml bool parsing improvements Nov 16, 2023
@cniethammer cniethammer changed the title Several xml bool parsing improvements Several xml parser improvements Nov 16, 2023
Copy link
Contributor

@HomesGH HomesGH left a comment

Choose a reason for hiding this comment

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

Thank you for this PR 😃 Looks good besides some smaller comments/questions.
Maybe we can also fix/unify the shifted value in in one of the components files (examples/DropletCoalescence/components.xml) with this PR?

src/utils/xmlfile.cpp Show resolved Hide resolved
src/utils/xmlfile.cpp Outdated Show resolved Hide resolved
Signed-off-by: Christoph Niethammer <[email protected]>
@cniethammer
Copy link
Contributor Author

Thank you for this PR 😃 Looks good besides some smaller comments/questions. Maybe we can also fix/unify the shifted value in in one of the components files (examples/DropletCoalescence/components.xml) with this PR?

I would clean up the examples in a separate PR later on.

@cniethammer cniethammer merged commit 3af34d9 into ls1mardyn:master Nov 17, 2023
52 checks passed
@cniethammer cniethammer deleted the feature-xml-bool-parsing-improvements branch February 13, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants