[boost::property_tree] how to put to paths with '/' slashes?

Hello everyne! I'm just looking at the property_tree and wonder, if I can do something like this: ptree my_tree; my_tree.put('/',"/path/to/my.node","hello world"); The get functions support this syntax, but I didn't see anything corresponding to it with put ? Any ideas, workarounds? Kind regards and thanks Julien -------- Music was my first love and it will be my last (John Miles) ======== FIND MY WEB-PROJECT AT: ======== http://ltsb.sourceforge.net the Linux TextBased Studio guide ======= AND MY PERSONAL PAGES AT: ======= http://www.juliencoder.de

On 09.05.2011 19:37, Julien Claassen wrote:
Hello everyne! I'm just looking at the property_tree and wonder, if I can do something like this: ptree my_tree; my_tree.put('/',"/path/to/my.node","hello world"); The get functions support this syntax, but I didn't see anything corresponding to it with put ? Any ideas, workarounds?
Actually, the syntax has changed, and your put call won't work. The correct syntax is: my_tree.put(path("path/to/my.node", '/'), "hello world"); my_tree.get(path("path/to/my.node", '/')); Sebastian

Hello Sebastian! Thanks for the info. I suspected, that there could be a way with constructing a path, butI didn't really know how. Kindest regards Julien -------- Music was my first love and it will be my last (John Miles) ======== FIND MY WEB-PROJECT AT: ======== http://ltsb.sourceforge.net the Linux TextBased Studio guide ======= AND MY PERSONAL PAGES AT: ======= http://www.juliencoder.de
participants (2)
-
Julien Claassen
-
Sebastian Redl