Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: char16_t/char_32_t support for read_xml #34

Open
Dani-Hub opened this issue Sep 15, 2018 · 0 comments
Open

Feature request: char16_t/char_32_t support for read_xml #34

Dani-Hub opened this issue Sep 15, 2018 · 0 comments

Comments

@Dani-Hub
Copy link

Dani-Hub commented Sep 15, 2018

Similar to this issue but less ambitious, I would like to suggest to provide minimum support for char16_t and char32_t to read XML, basically an extension of a previous BOM support issue. For example, the following code snippet does currently not compile:

#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>

int main()
{
  boost::property_tree::basic_ptree<std::u16string, std::u16string> pt;
  std::string filename("utf16.xml"); 
  read_xml(filename, pt);
}

producing the following compile error:

1>c:\projects\thirdparty\boost_1_68_0\boost\property_tree\detail\rapidxml.hpp(1374): error C2664: 'void boost::property_tree::detail::rapidxml::xml_document<Ch>::parse_bom<3072>(wchar_t *&)': cannot convert argument 1 from 'Ch *' to 'char *&'
1>        with
1>        [
1>            Ch=Ch
1>        ]
1>c:\projects\thirdparty\boost_1_68_0\boost\property_tree\detail\xml_parser_read_rapidxml.hpp(116): note: see reference to function template instantiation 'void boost::property_tree::detail::rapidxml::xml_document<Ch>::parse<3072>(Ch *)' being compiled
1>        with
1>        [
1>            Ch=Ch
1>        ]
1>c:\projects\thirdparty\boost_1_68_0\boost\property_tree\detail\xml_parser_read_rapidxml.hpp(116): note: see reference to function template instantiation 'void boost::property_tree::detail::rapidxml::xml_document<Ch>::parse<3072>(Ch *)' being compiled
1>        with
1>        [
1>            Ch=Ch
1>        ]
1>c:\projects\thirdparty\boost_1_68_0\boost\property_tree\xml_parser.hpp(85): note: see reference to function template instantiation 'void boost::property_tree::xml_parser::read_xml_internal<Ptree>(std::basic_istream<char16_t,std::char_traits<char16_t>> &,Ptree &,int,const std::string &)' being compiled
1>        with
1>        [
1>            Ptree=boost::property_tree::basic_ptree<std::u16string,std::u16string,std::less<std::u16string>>
1>        ]
[...]
1>Done building project "bdal-playground.vcxproj" -- FAILED.

First inspection indicates that there are only missing specializations of the parse_bom member template for types char16_t and char_32_t.

I'm willing to make a corresponding pull request, but opened this issue first to get feedback on this idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant