7 #include "boost/lexical_cast.hpp"
27 if(lval!=rval) attdiffs.push_back(
AttDiff(attname, lval, rval));
33 attdiffs.push_back(
AttDiff(attname, boost::lexical_cast<string,int>(lval), boost::lexical_cast<string,int>(rval) ));
39 attdiffs.push_back(
AttDiff(attname, boost::lexical_cast<string,unsigned int>(lval), boost::lexical_cast<string,unsigned int>(rval) ));
45 attdiffs.push_back(
AttDiff(attname, boost::lexical_cast<string,float>(lval), boost::lexical_cast<string,float>(rval) ));
51 attdiffs.push_back(
AttDiff(attname, boost::lexical_cast<string,bool>(lval), boost::lexical_cast<string,bool>(rval) ));
56 if(sub) subs.push_back(sub);
61 rightonly.insert( std::pair<string,string>(
tagname,
name) );
66 leftonly.insert( std::pair<string,string>(
tagname,
name) );
71 return attdiffs.size()==0 && subs.size()==0;
80 xmlfile <<
" name=\"" <<
name <<
"\"";
82 xmlfile <<
" " <<
d.attname <<
"_l=\"" <<
d.lval <<
"\" " <<
d.attname <<
"_r=\"" <<
d.rval <<
"\"";
83 if(subs.size()==0 && rightonly.size()==0 && leftonly.size()==0) {
84 xmlfile <<
"/>" << endl;
86 xmlfile <<
">" << endl;
88 d->writeXML(xmlfile,
prefix+
" ");
89 if(leftonly.size()>0) {
90 xmlfile <<
prefix <<
" <LEFT_ONLY>" << endl;
91 for(OnlyMap_t::value_type tag_name : leftonly)
92 xmlfile <<
prefix <<
" <" << tag_name.first <<
" name=\"" << tag_name.second <<
"\"/>" << endl;
93 xmlfile <<
prefix <<
" </LEFT_ONLY>" << endl;
95 if(rightonly.size()>0) {
96 xmlfile <<
prefix <<
" <RIGHT_ONLY>" << endl;
97 for(OnlyMap_t::value_type tag_name : rightonly)
98 xmlfile <<
prefix <<
" <" << tag_name.first <<
" name=\"" << tag_name.second <<
"\"/>" << endl;
99 xmlfile <<
prefix <<
" </RIGHT_ONLY>" << endl;