1

I tried using ptree to fetch value of key in c++ for key name having multiple . in keys.

so I have json,

"product": {
    "product.description.text": "Some text here"
}

I tried calling

std::string product = pt.get_value("product.product.description.text");

but can't get value. please help me

ElGavilan
  • 6,610
  • 16
  • 27
  • 36

1 Answers1

1

According to http://www.boost.org/doc/libs/1_43_0/doc/html/boost_propertytree/accessing.html You may use something like the following:

pt.get<std::string>('/', "product/product.description.text");
Jarod42
  • 203,559
  • 14
  • 181
  • 302