-// Copyright (C) 2006-2014 CEA/DEN, EDF R&D
+// Copyright (C) 2006-2015 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
template <class T>
void looptypeParser<T>::buildAttr(const XML_Char** attr)
{
+ if (!attr)
+ return;
this->required("name",attr);
for (int i = 0; attr[i]; i += 2)
{
T b=this->_cnode;
this->_cnodes.pop_back();
currentProc->names.pop_back();
- this->_cnode=this->_cnodes.back();
+ this->_cnode=this->_cnodes.empty() ? 0 : this->_cnodes.back();
return b;
}
}
template <class T>
void forlooptypeParser<T>::buildAttr(const XML_Char** attr)
{
+ if (!attr)
+ return;
this->required("name",attr);
for (int i = 0; attr[i]; i += 2)
{
T b=this->_cnode;
this->_cnodes.pop_back();
currentProc->names.pop_back();
- this->_cnode=this->_cnodes.back();
+ this->_cnode=this->_cnodes.empty() ? 0 : this->_cnodes.back();
return b;
}
DEBTRACE("pseudocomposednode_post" << this->_cnode->getNode()->getName())
T b = this->_cnode;
this->_cnodes.pop_back();
- if(this->_cnodes.size() == 0)
- this->_cnode = 0;
- else
- this->_cnode = this->_cnodes.back();
+ this->_cnode=this->_cnodes.empty() ? 0 : this->_cnodes.back();
return b;
}
virtual void buildAttr(const XML_Char** attr)
{
+ if (!attr)
+ return;
this->required("name",attr);
this->required("type",attr);
for (int i = 0; attr[i]; i += 2)
T b=this->_cnode;
this->_cnodes.pop_back();
currentProc->names.pop_back();
- if(this->_cnodes.size() == 0)
- this->_cnode=0;
- else
- this->_cnode=this->_cnodes.back();
+ this->_cnode=this->_cnodes.empty() ? 0 : this->_cnodes.back();
return b;
}
int _nbranch;
virtual void buildAttr(const XML_Char** attr)
{
+ if (!attr)
+ return;
this->required("name",attr);
this->required("lib",attr);
this->required("entry",attr);
T b=this->_cnode;
this->_cnodes.pop_back();
currentProc->names.pop_back();
- if(this->_cnodes.size() == 0)
- this->_cnode=0;
- else
- this->_cnode=this->_cnodes.back();
+ this->_cnode=this->_cnodes.empty() ? 0 : this->_cnodes.back();
return b;
}