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

Improvement suggestion #153

Closed
adorostkar opened this issue Sep 20, 2014 · 3 comments
Closed

Improvement suggestion #153

adorostkar opened this issue Sep 20, 2014 · 3 comments

Comments

@adorostkar
Copy link

Hi,
I would like to suggest two improvements to rapidJson

  1. Support c/c++ type comment in JSON file. It would be very beneficial if one can have comments in the JSON file.
  2. A generic method that gets a type argument and converts the value to that argument type. i.e.
    doc["key"]->Get < int > ();

Thank you,
Ashkan

@pah
Copy link
Contributor

pah commented Sep 22, 2014

  1. is discussed in Strict/Relaxed JSON syntax #36
    I think, a solution to this will require some internal changes to allow user-defined customizations of the parser.
  2. Do you suggest to have "lossy conversions" for non-matching values? What should Get<int>() return, if doc["key"].IsString() == true? Safe conversions are already supported (e.g. GetInt64() can be used, even if IsUint() == true).

@adorostkar
Copy link
Author

Thank you,

The second point is useful in my opinion for generic coding if one wants to pass the template argument directly to parser. I could through an exception in case the types are not compatible.

@miloyip
Copy link
Collaborator

miloyip commented Apr 24, 2015

I added #316 for the second point, in order to replace this issue.

@miloyip miloyip closed this as completed Apr 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants