1 #ifndef __XIOS_CXML_PARSER_IMPL__
2 #define __XIOS_CXML_PARSER_IMPL__
14 while(!stream.eof() && !stream.fail ()) oss.put(stream.get());
15 const StdString xmlcontent( oss.str(), 0, oss.str().size()-1 );
18 rapidxml::xml_document<char> doc;
19 doc.parse<0>(
const_cast<char*
>(xmlcontent.c_str()));
23 catch (rapidxml::parse_error & exc)
25 const char* ptr = exc.where<
char>() ;
26 const char* begin = xmlcontent.c_str() ;
27 const char* content=oss.str().c_str() ;
28 size_t pos=ptr-begin ;
30 int columnNumber = 0 ;
34 for(
const char* i=content;i<content+pos; ++i, ++columnNumber)
if (*i==
'\n') { lineNumber++ ; line=i ; columnNumber=0 ;}
35 for(endLine=content+pos; *endLine!=
'\n' && *endLine!=
'\0' ; ++endLine) ;
36 string strLine(line,endLine-line) ;
38 ERROR(
"CXMLParser::ParseStream(StdIStream & stream)", << endl
39 <<
"Error is occuring when parsing XML flux from <"<<fluxId<<
"> at character "<< pos<<
" line "<<lineNumber<<
" column "<< columnNumber<< endl
41 <<
string(columnNumber-1,
'x')<<
'^'<<endl)
49 #endif // __XIOS_CXML_PARSER_IMPL__
CATCH CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar *scalarDestination, CScalar *scalarSource, CReduceScalarToScalar *algo ERROR)("CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo)",<< "Operation must be defined."<< "Scalar source "<< scalarSource->getId()<< std::endl<< "Scalar destination "<< scalarDestination->getId())
static void ParseInclude(StdIStream &stream, const string &fluxId, T &object)
std::ostringstream StdOStringStream
Définition de types (issus de la bibliothèque standard)///.