Subject: [Boost-bugs] [Boost C++ Libraries] #4738: property_tree parsers fail when top node has data()
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-10-14 16:43:22
#4738: property_tree parsers fail when top node has data()
-----------------------------------------------+----------------------------
Reporter: Jess <jess@â¦> | Owner: cornedbee
Type: Bugs | Status: new
Milestone: To Be Determined | Component: property_tree
Version: Boost 1.43.0 | Severity: Problem
Keywords: property_tree, data, root, parser |
-----------------------------------------------+----------------------------
{{{
ptree tree( "DATA" );
write_xml( "test.xml", tree ); // writes out DATA with no tag
read_xml( "test.xml", tree ); // fails since cannot read DATA without a
tag.
}}}
{{{
ptree pt1( "DATA" );
write_info( "test.info", tree ); // does not write DATA at all
ptree pt2;
read_info( "test.info", pt2 ); // reads in empty ptree
BOOST_CHECK( pt1 == pt2 ); // fails since the node has no data
}}}
--------------------
These could be easy fixes but some convention will have to be adopted.
The info parser could be modified to write out the top level data when
indent==-1 but the reader would then have to interpret an initial string
with no following data or children to as data(). Alternatively there
could be a null key represented by "" or some special character.
The XML is trickier because the DATA either needs to be an attribute or
needs some sort of tag, or it cannot be parsed as XML.
I only checked this on the 1.43.0 that I have installed but it does not
appear that the problem has been fixed in 1.44.0 or in subversion.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4738> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC