Ignore:
Timestamp:
03/22/18 10:43:20 (6 years ago)
Author:
yushan
Message:

branch_openmp merged with XIOS_DEV_CMIP6@1459

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/src/xml_parser.hpp

    r1331 r1460  
    1010namespace xios 
    1111{ 
    12   namespace xml 
    13   { 
    14     /// ////////////////////// Déclarations ////////////////////// /// 
    15     class CXMLParser 
    16     { 
    17       public : 
    18         static void ParseFile(const StdString & filename, const std::set<StdString>& parseList = std::set<StdString>()); 
    19         static void ParseString(const StdString & xmlContent); 
    20         static void ParseStream(StdIStream & stream, const string& fluxId, const std::set<StdString>& parseList); 
    21         template <class T> 
    22         static void ParseInclude(StdIStream & stream, const string& fluxId, T & object); 
     12   namespace xml 
     13   { 
     14      /// ////////////////////// Déclarations ////////////////////// /// 
     15      class CXMLParser 
     16      { 
     17         public : 
    2318 
    24     }; //class CXMLParser 
    25   }// namespace xml 
     19            static void ParseFile(const StdString & filename, const std::set<StdString>& parseList = std::set<StdString>()); 
     20            static void ParseString(const StdString & xmlContent); 
     21            static void ParseStream(StdIStream & stream, const string& fluxId, const std::set<StdString>& parseList); 
     22            template <class T> 
     23               static void ParseInclude(StdIStream & stream, const string& fluxId, T & object); 
     24 
     25      }; //class CXMLParser 
     26/* 
     27      template <class T> 
     28         void CXMLParser::ParseInclude(StdIStream & stream, T& object) 
     29      { 
     30         StdOStringStream oss; 
     31         while(!stream.eof() && !stream.fail ()) 
     32            oss.put(stream.get()); 
     33         try 
     34         { 
     35            const StdString xmlcontent( oss.str(), 0, oss.str().size()-1 ); 
     36            rapidxml::xml_document<char> doc; 
     37            doc.parse<0>(const_cast<char*>(xmlcontent.c_str())); 
     38            CXMLNode node(doc.first_node()); 
     39            object.parse(node); 
     40         } 
     41         catch (rapidxml::parse_error & exc) 
     42         { 
     43            ERROR("CXMLParser::ParseStream(StdIStream & stream)", 
     44                  << "RapidXML error : " << exc.what() << " !"); 
     45         } 
     46      } 
     47*/ 
     48   }// namespace xml 
    2649} // namespace xios 
    2750 
Note: See TracChangeset for help on using the changeset viewer.