Boost logo

Boost :

Subject: [boost] [property_tree] Assign and Lua parser
From: Renato Florentino Garcia (fgarcia.renato_at_[hidden])
Date: 2011-11-15 00:18:45

In my use of Boost Property Tree library I have coded some extensions,
which are in a GitHub repository (

I would like to know if there are any interest in make any of then part of
Boost Property Tree itself, probably after a suggest improvement.

The more useful in my view is a Boost Assign Property Tree alike.

For instance, to build in C++ code a ptree like:

key1 value1
    key3 12345
        key4 "value4 with spaces"
    key5 value5
    "" 10
    "" 11
    "" 12

Instead the current:

ptree pt;
pt.add("key1", "value1");
ptree tmpPt1;
tmpPt1.add("key3", 12345);
ptree tmpPt2;
tmpPt2.add("key4", "value4 with spaces");
tmpPt1.push_back(std::make_pair("", tmpPt2));
tmpPt1.add("key5", "value5");
ptree tmpPt3;
tmpPt1.push_back(std::make_pair("", tmpPt3));
ptree tmpPt4;
tmpPt1.push_back(std::make_pair("", tmpPt4));
ptree tmpPt5;
tmpPt1.push_back(std::make_pair("", tmpPt5));
pt.add_child("key2", tmpPt1);

Would be a code like:

ptree pt =
    ("key1", "value1")
    ("key2", tree()
        ("key3", 12345)
            ("key4", "value4 with spaces"))
        ("key5", "value5")

Another extension is a Lua parser, like the XML or JSON. But in this case I
don't think that is desirable include it in the Boost, because of the
needed of Lua libraries (at least not in a mandatory way).


Renato Garcia

Boost list run by bdawes at, gregod at, cpdaniel at, john at