From f351ba03ebf31103c0a6a0c00b1477d39c060139 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 27 Nov 2017 18:28:06 +0000 Subject: Add some helpers for attribute lookup This CL adds helpers to CXFA_Node to convert from strings to attributes and from attributes to their string names. A static_assert was added to make sure the list of attributes is the same size as the attribute data so the checks can be removed. Change-Id: Idebc65021d71f604bcf498e4cf42252af00d802b Reviewed-on: https://pdfium-review.googlesource.com/19270 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- xfa/fxfa/parser/cxfa_node.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xfa/fxfa/parser/cxfa_node.h') diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h index 7b7086ecb5..e5f47a1828 100644 --- a/xfa/fxfa/parser/cxfa_node.h +++ b/xfa/fxfa/parser/cxfa_node.h @@ -53,6 +53,8 @@ class CXFA_Node : public CXFA_Object { uint8_t flags; }; + static WideString AttributeToName(XFA_Attribute attr); + static XFA_Attribute NameToAttribute(const WideStringView& name); static XFA_Element NameToElement(const WideString& name); static std::unique_ptr Create(CXFA_Document* doc, XFA_Element element, -- cgit v1.2.3