New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
xml_parser_impl.hpp in vendors/XIOS/current/src – NEMO

source: vendors/XIOS/current/src/xml_parser_impl.hpp @ 3428

Last change on this file since 3428 was 3428, checked in by rblod, 12 years ago

importing initial XIOS vendor drop

File size: 954 bytes
Line 
1#ifndef __XMLIO_CXML_PARSER_IMPL__
2#define __XMLIO_CXML_PARSER_IMPL__
3
4/// xios headers ///
5#include "xml_parser.hpp"
6
7namespace xios
8{
9   namespace xml
10   {
11     template <class T> void CXMLParser::ParseInclude(StdIStream & stream, T& object)
12      {
13         StdOStringStream oss;
14         while(!stream.eof() && !stream.fail ())
15            oss.put(stream.get());
16         try
17         {
18            const StdString xmlcontent( oss.str(), 0, oss.str().size()-1 );
19            rapidxml::xml_document<char> doc;
20            doc.parse<0>(const_cast<char*>(xmlcontent.c_str()));
21            CXMLNode node(doc.first_node());
22            object.parse(node);
23         }
24         catch (rapidxml::parse_error & exc)
25         {
26            ERROR("CXMLParser::ParseStream(StdIStream & stream)",
27                  << "RapidXML error : " << exc.what() << " !");
28         }
29      }
30
31   } // namespace xml
32} // namespace xios
33
34#endif // __XMLIO_CXML_PARSER_IMPL__
35
Note: See TracBrowser for help on using the repository browser.