| 280 | } |
| 281 | |
| 282 | std::unique_ptr<Element> Element::createCopy() |
| 283 | { |
| 284 | auto elem = std::make_unique<Element>(mName, nullptr, mType, mContent); |
| 285 | elem->mAttributes = mAttributes; |
| 286 | |
| 287 | for (const auto& oldChild : mChildren) |
| 288 | { |
| 289 | auto child = oldChild->createCopy(); |
| 290 | child->mParent = elem.get(); |
| 291 | elem->mChildren.emplace_back(std::move(child)); |
| 292 | } |
| 293 | |
| 294 | return elem; |
| 295 | } |
| 296 | |
| 297 | void Element::setAttribute(std::string_view _key, std::string_view _value) |
| 298 | { |