summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml/cxml_element.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-10-05 12:11:03 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-10-05 17:04:48 +0000
commit5e2cfb5310c9b25a5ce4c772a6656373309bc956 (patch)
treedaba5cee8c19d5035d532c4d47c0993f1cdae868 /core/fxcrt/xml/cxml_element.h
parent41bf73a2c389d8fa811cabb1867b8b6a5585d5eb (diff)
downloadpdfium-5e2cfb5310c9b25a5ce4c772a6656373309bc956.tar.xz
Remove friends from CXML_Element
This CL removes the friends from CXML_Element and adds accessors as needed. Change-Id: I4f76935caa753a063bef4ff2d043273ae4e14e14 Reviewed-on: https://pdfium-review.googlesource.com/15535 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/xml/cxml_element.h')
-rw-r--r--core/fxcrt/xml/cxml_element.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/core/fxcrt/xml/cxml_element.h b/core/fxcrt/xml/cxml_element.h
index 40ebe385b7..a851a86f1c 100644
--- a/core/fxcrt/xml/cxml_element.h
+++ b/core/fxcrt/xml/cxml_element.h
@@ -8,6 +8,7 @@
#define CORE_FXCRT_XML_CXML_ELEMENT_H_
#include <memory>
+#include <utility>
#include <vector>
#include "core/fxcrt/xml/cxml_attrmap.h"
@@ -87,6 +88,10 @@ class CXML_Element : public CXML_Object {
return attr;
}
+ void AppendChild(std::unique_ptr<CXML_Object> child) {
+ m_Children.push_back(std::move(child));
+ }
+
uint32_t CountChildren() const { return m_Children.size(); }
uint32_t CountElements(const ByteStringView& space,
const ByteStringView& tag) const;
@@ -98,10 +103,13 @@ class CXML_Element : public CXML_Object {
void SetTag(const ByteStringView& qTagName);
void RemoveChild(uint32_t index);
- private:
- friend class CXML_Parser;
- friend class CXML_Composer;
+ void SetAttribute(const ByteString& space,
+ const ByteString& name,
+ const WideString& value) {
+ m_AttrMap.SetAt(space, name, value);
+ }
+ private:
UnownedPtr<const CXML_Element> const m_pParent;
ByteString m_QSpaceName;
ByteString m_TagName;