xref: /aosp_15_r20/external/pdfium/core/fxcrt/xml/cfx_xmldocument.cpp (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2018 The PDFium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "core/fxcrt/xml/cfx_xmldocument.h"
6 
7 #include "core/fxcrt/fx_system.h"
8 #include "core/fxcrt/xml/cfx_xmlelement.h"
9 #include "core/fxcrt/xml/cfx_xmlinstruction.h"
10 
CFX_XMLDocument()11 CFX_XMLDocument::CFX_XMLDocument()
12     : root_(CreateNode<CFX_XMLElement>(L"root")) {}
13 
14 CFX_XMLDocument::~CFX_XMLDocument() = default;
15 
AppendNodesFrom(CFX_XMLDocument * other)16 void CFX_XMLDocument::AppendNodesFrom(CFX_XMLDocument* other) {
17   nodes_.reserve(nodes_.size() + other->nodes_.size());
18   nodes_.insert(nodes_.end(), std::make_move_iterator(other->nodes_.begin()),
19                 std::make_move_iterator(other->nodes_.end()));
20   other->nodes_.clear();
21 }
22