MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / Save

Method Save

src/App/PropertyExpressionEngine.cpp:418–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416}
417
418void PropertyExpressionEngine::Save(Base::Writer& writer) const
419{
420 writer.Stream() << writer.ind() << "<ExpressionEngine count=\"" << expressions.size();
421 if (PropertyExpressionContainer::_XLinks.empty()) {
422 writer.Stream() << "\">" << std::endl;
423 writer.incInd();
424 }
425 else {
426 writer.Stream() << R"(" xlink="1">)" << std::endl;
427 writer.incInd();
428 PropertyExpressionContainer::Save(writer);
429 }
430 for (const auto& it : expressions) {
431 std::string expression, comment;
432 if (it.second.expression) {
433 expression = it.second.expression->toString(true);
434 comment = it.second.expression->comment;
435 }
436
437 writer.Stream() << writer.ind() << "<Expression path=\""
438 << Property::encodeAttribute(it.first.toString()) << "\" expression=\""
439 << Property::encodeAttribute(expression) << "\"";
440 if (!comment.empty()) {
441 writer.Stream() << " comment=\"" << Property::encodeAttribute(comment) << "\"";
442 }
443 writer.Stream() << "/>" << std::endl;
444 }
445 writer.decInd();
446 writer.Stream() << writer.ind() << "</ExpressionEngine>" << std::endl;
447}
448
449void PropertyExpressionEngine::Restore(Base::XMLReader& reader)
450{

Callers

nothing calls this directly

Calls 5

incIndMethod · 0.80
decIndMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected