From: Yurii R. <yr...@us...> - 2003-02-04 04:13:55
|
Update of /cvsroot/eas-dev/eas-dev/libs/libsxmlstream/src In directory sc8-pr-cvs1:/tmp/cvs-serv15952/src Modified Files: sxmlstream.cxx Log Message: bugfix in binary serialization, binary output test fixed Index: sxmlstream.cxx =================================================================== RCS file: /cvsroot/eas-dev/eas-dev/libs/libsxmlstream/src/sxmlstream.cxx,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- sxmlstream.cxx 3 Feb 2003 18:59:38 -0000 1.10 +++ sxmlstream.cxx 4 Feb 2003 04:13:51 -0000 1.11 @@ -78,16 +78,27 @@ // Output attributes if (!e.descendants.empty()) { iter = e.descendants.begin(); + bool has_attrs = false; + while (iter!=e.descendants.end()) + { + if (iter->isAttribute()) has_attrs = true; + iter++; + } + if (has_attrs) { + iter = e.descendants.begin(); + os << BIN_LBRACKET << BIN_SIGN_ATTR; while (iter!=e.descendants.end()) { if (iter->isAttribute()) { - os << BIN_LBRACKET << BIN_SIGN_ATTR; + SXml_BinaryOutput(os,(*iter)); - os << BIN_RBRACKET; + } iter++; } + os << BIN_RBRACKET; + } } // Output descendants if (!e.descendants.empty()) { @@ -111,12 +122,13 @@ BIN_PORTABLE_SIZE(e.data.length()) << e.data << BIN_PORTABLE_SIZE((e.getProperty()).length()) << - e.getProperty() << BIN_LBRACKET; + e.getProperty() << BIN_RBRACKET; } else { os << BIN_LBRACKET << BIN_PORTABLE_SIZE(e.data.length()) << - e.data << BIN_RBRACKET; + e.data << BIN_PORTABLE_SIZE(0) << + BIN_RBRACKET; } break; |