From 2eca482beccd1795b63ff0022df4539932ffce14 Mon Sep 17 00:00:00 2001 From: Jeremiah Willcock Date: Sun, 6 Dec 2009 03:53:14 +0000 Subject: [PATCH] Changed to property_tree copy of encode_char_entities [SVN r58180] --- include/boost/graph/graphml.hpp | 54 +-------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/include/boost/graph/graphml.hpp b/include/boost/graph/graphml.hpp index c5d87c7f..2193b4ce 100644 --- a/include/boost/graph/graphml.hpp +++ b/include/boost/graph/graphml.hpp @@ -23,64 +23,13 @@ #include #include #include -#if 0 // Change this back later #include -#endif #include #include namespace boost { - // FIXME: Remove this once property_tree is stable - namespace graph_detail_from_property_tree { - -// ---------------------------------------------------------------------------- -// Copyright (C) 2002-2006 Marcin Kalicinski -// -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// For more information, see www.boost.org -// ---------------------------------------------------------------------------- - - // Naively convert narrow string to another character type - template - std::basic_string widen(const char *text) - { - std::basic_string result; - while (*text) - { - result += Ch(*text); - ++text; - } - return result; - } - - template - std::basic_string encode_char_entities(const std::basic_string &s) - { - typedef typename std::basic_string Str; - Str r; - typename Str::const_iterator end = s.end(); - for (typename Str::const_iterator it = s.begin(); it != end; ++it) - { - switch (*it) - { - case Ch('<'): r += boost::graph_detail_from_property_tree::widen("<"); break; - case Ch('>'): r += boost::graph_detail_from_property_tree::widen(">"); break; - case Ch('&'): r += boost::graph_detail_from_property_tree::widen("&"); break; - case Ch('"'): r += boost::graph_detail_from_property_tree::widen("""); break; - case Ch('\''): r += boost::graph_detail_from_property_tree::widen("'"); break; - default: r += *it; break; - } - } - return r; - } - - } - ///////////////////////////////////////////////////////////////////////////// // Graph reader exceptions ///////////////////////////////////////////////////////////////////////////// @@ -280,8 +229,7 @@ write_graphml(std::ostream& out, const Graph& g, VertexIndexMap vertex_index, typedef typename graph_traits::edge_descriptor edge_descriptor; typedef typename graph_traits::vertex_descriptor vertex_descriptor; - // using boost::property_tree::xml_parser::encode_char_entities; - using boost::graph_detail_from_property_tree::encode_char_entities; + using boost::property_tree::xml_parser::encode_char_entities; BOOST_STATIC_CONSTANT(bool, graph_is_directed =