[xsde-users] hello example parser with std

maxim maxim look2006il at gmail.com
Tue Jul 23 12:38:35 EDT 2013


Hello to all users,

I'm trying to run hello parser example, but instead of the doc_p.parse
("hello.xml"); I'm using with std::string as following:

 std::string contents;
 std::ifstream in("hello.xml", std::ios::in | std::ios::binary);
  if (in)
  {
    in.seekg(0, std::ios::end);
    contents.resize(in.tellg());
    in.seekg(0, std::ios::beg);
    in.read(&contents[0], contents.size());
    in.close();
  }
doc_p.parse (contents);

But after running doc_p.parse (contents);  I have the following error :

terminate called after throwing an instance of 'std::ios_base::failure'
  what():  basic_ios::clear
Anybody could help me with it, why is it happening, and how I can resolve
it?


Thanks,
Maxim


More information about the xsde-users mailing list