Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Feature request: Support jsonc parsing #404

Closed

Description

@AndrewNolte

I'd like to use reflect-cpp to parse a config, so ideally json with comments (jsonc) would be supported with a processor like rfl::Comments or rfl::JsonC

Activity

  1. liuzicheng1987 commented on Apr 13, 2025

    @liuzicheng1987
    Collaborator

    Hi @AndrewNolte ,

    do you know a good C/C++ library for the json format that we could wrap?

  2. AndrewNolte commented on Apr 18, 2025

    @AndrewNolte
    ContributorAuthor

    I think the format is a pretty simple extension of json, we would just need to filter out the comments before parsing. https://github.com/Microsoft/node-jsonc-parser is the impl I'm referencing. I see actually there's a yyjson flag called YYJSON_READ_ALLOW_COMMENTS, so maybe this would be pretty simple to support.

  3. liuzicheng1987 commented on Apr 19, 2025

    @liuzicheng1987
    Collaborator

    @AndrewNolte I like the idea of just using the YYJSON flag.

  4. Altren commented on May 1, 2025

    @Altren
    Contributor

    In fact this is possible since 0.18 release:
    rfl::json::load<T>(fileName, YYJSON_READ_ALLOW_COMMENTS)

  5. AndrewNolte commented on May 2, 2025

    @AndrewNolte
    ContributorAuthor

    Awesome thanks! Here's a PR to add flag passing to the other json read() method- #425

  6. liuzicheng1987 commented on May 6, 2025

    @liuzicheng1987
    Collaborator

    Can we close this issue? @Altren @AndrewNolte

  7. Altren commented on May 6, 2025

    @Altren
    Contributor

    Yes, it is all there now

  8. AndrewNolte commented on May 9, 2025

    @AndrewNolte
    ContributorAuthor

    Yep thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions