summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml/cfx_xmlnode.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-02-13 21:44:33 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-13 21:44:33 +0000
commitfa3765cce4da4c3923e525f0462afd794360d221 (patch)
tree2a246bc47d7584edf5d8dd2c124f6c21c26cd5c8 /core/fxcrt/xml/cfx_xmlnode.h
parent9c112f92d4c2046d5a4f8538f4d18b74a87649d4 (diff)
downloadpdfium-fa3765cce4da4c3923e525f0462afd794360d221.tar.xz
Cleanup CFX_XMLNode pointers
This CL cleans up hte CFX_XMLNode pointers. Each pointer has been renamed to make the usage clearer, the NodeItems method has been removed in favour of distinct accessors and the node pointers have been made private. Change-Id: I5459a77a0ae93b08741a0cd59266ef9c81ddad75 Reviewed-on: https://pdfium-review.googlesource.com/26550 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcrt/xml/cfx_xmlnode.h')
-rw-r--r--core/fxcrt/xml/cfx_xmlnode.h23
1 files changed, 10 insertions, 13 deletions
diff --git a/core/fxcrt/xml/cfx_xmlnode.h b/core/fxcrt/xml/cfx_xmlnode.h
index dc3152f19a..55c79dcfe0 100644
--- a/core/fxcrt/xml/cfx_xmlnode.h
+++ b/core/fxcrt/xml/cfx_xmlnode.h
@@ -27,32 +27,29 @@ struct FX_XMLNODE {
class CFX_XMLNode {
public:
- enum NodeItem {
- Root = 0,
- Parent,
- NextSibling,
- FirstChild,
- };
-
CFX_XMLNode();
virtual ~CFX_XMLNode();
virtual FX_XMLNODETYPE GetType() const;
virtual std::unique_ptr<CFX_XMLNode> Clone();
+ CFX_XMLNode* GetRoot();
+ CFX_XMLNode* GetParent() const { return parent_; }
+ CFX_XMLNode* GetFirstChild() const { return first_child_; }
+ CFX_XMLNode* GetNextSibling() const { return next_sibling_; }
+
void AppendChild(CFX_XMLNode* pNode);
void InsertChildNode(CFX_XMLNode* pNode, int32_t index);
void RemoveChildNode(CFX_XMLNode* pNode);
void DeleteChildren();
- CFX_XMLNode* GetNodeItem(CFX_XMLNode::NodeItem eItem) const;
-
void SaveXMLNode(const RetainPtr<CFX_SeekableStreamProxy>& pXMLStream);
- CFX_XMLNode* m_pParent;
- CFX_XMLNode* m_pChild;
- CFX_XMLNode* m_pPrior;
- CFX_XMLNode* m_pNext;
+ private:
+ CFX_XMLNode* parent_ = nullptr;
+ CFX_XMLNode* first_child_ = nullptr;
+ CFX_XMLNode* prev_sibling_ = nullptr;
+ CFX_XMLNode* next_sibling_ = nullptr;
};
#endif // CORE_FXCRT_XML_CFX_XMLNODE_H_