1 // ----------------------------------------------------------------------------
2 // Copyright (C) 2002-2007 Marcin Kalicinski
3 // Copyright (C) 2007 Alexey Baskakov
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 // For more information, see www.boost.org
10 // ----------------------------------------------------------------------------
11 #ifndef BOOST_PROPERTY_TREE_DETAIL_XML_PARSER_WRITER_SETTINGS_HPP_INCLUDED
12 #define BOOST_PROPERTY_TREE_DETAIL_XML_PARSER_WRITER_SETTINGS_HPP_INCLUDED
15 #include <boost/property_tree/detail/ptree_utils.hpp>
17 namespace boost { namespace property_tree { namespace xml_parser
20 // Naively convert narrow string to another character type
22 Str widen(const char *text)
24 typedef typename Str::value_type Ch;
34 //! Xml writer settings. The default settings lead to no pretty printing.
36 class xml_writer_settings
38 typedef typename Str::value_type Ch;
40 xml_writer_settings(Ch inchar = Ch(' '),
41 typename Str::size_type incount = 0,
42 const Str &enc = widen<Str>("utf-8"))
44 , indent_count(incount)
50 typename Str::size_type indent_count;
55 xml_writer_settings<Str> xml_writer_make_settings(typename Str::value_type indent_char = (typename Str::value_type)(' '),
56 typename Str::size_type indent_count = 0,
57 const Str &encoding = widen<Str>("utf-8"))
59 return xml_writer_settings<Str>(indent_char, indent_count, encoding);