| 1488 | } |
| 1489 | |
| 1490 | void Document::writeObjects(const std::vector<DocumentObject*>& objs, |
| 1491 | Base::Writer& writer) const |
| 1492 | { |
| 1493 | std::ostream& str = writer.Stream(); |
| 1494 | |
| 1495 | // writing the features types |
| 1496 | writer.incInd(); // indentation for 'Objects count' |
| 1497 | str << writer.ind() << "<Objects Count=\"" << objs.size(); |
| 1498 | if (!isExporting(nullptr)) { |
| 1499 | str << "\" " << fcAttrDependencies << "=\"1"; |
| 1500 | } |
| 1501 | str << "\">\n"; |
| 1502 | |
| 1503 | writer.incInd(); // indentation for 'Object type' |
| 1504 | |
| 1505 | if (!isExporting(nullptr)) { |
| 1506 | writeObjectDeps(objs, writer); |
| 1507 | } |
| 1508 | |
| 1509 | writeObjectType(objs, writer); |
| 1510 | |
| 1511 | writer.decInd(); // indentation for 'Object type' |
| 1512 | str << writer.ind() << "</Objects>\n"; |
| 1513 | |
| 1514 | writeObjectData(objs, writer); |
| 1515 | writer.decInd(); // indentation for 'Objects count' |
| 1516 | |
| 1517 | // check for errors |
| 1518 | if (writer.hasFailed()) { |
| 1519 | std::cerr << "Output stream is in error state. As a result the " |
| 1520 | "Document.xml file may be incomplete.\n"; |
| 1521 | // reset the error flags to try to safe the data files |
| 1522 | writer.clear(); |
| 1523 | } |
| 1524 | } |
| 1525 | |
| 1526 | struct DepInfo |
| 1527 | { |