| 416 | } |
| 417 | |
| 418 | void 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 | |
| 449 | void PropertyExpressionEngine::Restore(Base::XMLReader& reader) |
| 450 | { |