Skip to content

change json inplace #25

@topolsky

Description

@topolsky

Hi,

I am trying to implement function to get json, change some part of it and return the changed json.
I thought that its easy.. just parse the json, cast it with AsObject AsArray etc.. change the values inside and then call Stringify on root JSONValue..

But then I found out that the AsObject/AsArray functions are returing const reference which cannot be changed.

I thought that I will use JSONValue::Child() for that but I am not sure if it would work for ::Child(wchar_t*) because there is some const_iterator used..

Is there any way how to achieve inplace change of json easily?
Maybe I overlook/misunderstood something.. sorry for dumb question opening issue..

Also regarding the Child() methods .. why do you not overload subscript [] operator?
Maybe in that way we could just check whats inside JSONValue and go on with [] which would make things easier.. now I have to do the casts all the time which makes it harder to read..

Thanks for your work, I am glad that I do not have to do json stuff myself.. and also your lib compiles on Win XP SP1 which is (sadly) requirement for me :D

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions