Menu

How to stop writer to write elements in alphabetical order?

2013-05-15
2014-04-19
  • wong wai lok

    wong wai lok - 2013-05-15

    I have the following problem when I am using Json::Value to write json string...

    Json::Value v;
    v["b"] = 5;
    v["c"] = 6;
    v["a"] = 7;

    cout << v << endl;

    The order in the created JSON output string:
    {
    "a" : 7,
    "b" : 5,
    "c" : 6
    }

    Is there anyway to have output as following?
    {
    "b" : 5,
    "c" : 6,
    "a" : 7

    }

     

    Last edit: wong wai lok 2013-05-15
  • Christopher Dunn

    We might provide a SortedWriter someday, but not before other features. Sorry.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.