diff options
author | dsinclair <dsinclair@chromium.org> | 2016-04-04 11:55:38 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-04 11:55:38 -0700 |
commit | 6e56a5ebc88e05fe0bf05624eba9aeed57fa6d60 (patch) | |
tree | 298fe044daa5bcee963fc9c8b398fd870c5b9571 /xfa/fde/xml/fde_xml_imp.h | |
parent | 5838dbd3809d1d16945009c7f9d6111dda3797f0 (diff) | |
download | pdfium-6e56a5ebc88e05fe0bf05624eba9aeed57fa6d60.tar.xz |
Replace FDE_XMLSYNTAX defines with enum classes.
This CL replaces FDE_XMLSYNTAXMODE_ with FDE_XmlSyntaxState:: and
FDE_XMLSYNTAXSTATUS_ with FDE_XmlSyntaxResult::. The various variables also
have their names updated to make them clearer.
Review URL: https://codereview.chromium.org/1856003002
Diffstat (limited to 'xfa/fde/xml/fde_xml_imp.h')
-rw-r--r-- | xfa/fde/xml/fde_xml_imp.h | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/xfa/fde/xml/fde_xml_imp.h b/xfa/fde/xml/fde_xml_imp.h index 0f252c12dd..396423a0c1 100644 --- a/xfa/fde/xml/fde_xml_imp.h +++ b/xfa/fde/xml/fde_xml_imp.h @@ -291,27 +291,6 @@ class CFDE_BlockBuffer : public CFX_Target { int32_t m_iStartPosition; }; -#define FDE_XMLSYNTAXMODE_Text 0 -#define FDE_XMLSYNTAXMODE_Node 1 -#define FDE_XMLSYNTAXMODE_Target 2 -#define FDE_XMLSYNTAXMODE_Tag 3 -#define FDE_XMLSYNTAXMODE_AttriName 4 -#define FDE_XMLSYNTAXMODE_AttriEqualSign 5 -#define FDE_XMLSYNTAXMODE_AttriQuotation 6 -#define FDE_XMLSYNTAXMODE_AttriValue 7 -#define FDE_XMLSYNTAXMODE_Entity 8 -#define FDE_XMLSYNTAXMODE_EntityDecimal 9 -#define FDE_XMLSYNTAXMODE_EntityHex 10 -#define FDE_XMLSYNTAXMODE_CloseInstruction 11 -#define FDE_XMLSYNTAXMODE_BreakElement 12 -#define FDE_XMLSYNTAXMODE_CloseElement 13 -#define FDE_XMLSYNTAXMODE_SkipDeclNode 14 -#define FDE_XMLSYNTAXMODE_DeclCharData 15 -#define FDE_XMLSYNTAXMODE_SkipComment 16 -#define FDE_XMLSYNTAXMODE_SkipCommentOrDecl 17 -#define FDE_XMLSYNTAXMODE_SkipCData 18 -#define FDE_XMLSYNTAXMODE_TargetData 19 - class CFDE_XMLSyntaxParser : public CFX_Target { public: CFDE_XMLSyntaxParser(); @@ -320,7 +299,7 @@ class CFDE_XMLSyntaxParser : public CFX_Target { void Init(IFX_Stream* pStream, int32_t iXMLPlaneSize, int32_t iTextDataSize = 256); - uint32_t DoSyntaxParse(); + FDE_XmlSyntaxResult DoSyntaxParse(); int32_t GetStatus() const; int32_t GetCurrentPos() const { return m_iParsedChars + (m_pStart - m_pBuffer); @@ -349,6 +328,29 @@ class CFDE_XMLSyntaxParser : public CFX_Target { } protected: + enum class FDE_XmlSyntaxState { + Text, + Node, + Target, + Tag, + AttriName, + AttriEqualSign, + AttriQuotation, + AttriValue, + Entity, + EntityDecimal, + EntityHex, + CloseInstruction, + BreakElement, + CloseElement, + SkipDeclNode, + DeclCharData, + SkipComment, + SkipCommentOrDecl, + SkipCData, + TargetData + }; + IFX_Stream* m_pStream; int32_t m_iXMLPlaneSize; int32_t m_iCurrentPos; @@ -369,8 +371,8 @@ class CFDE_XMLSyntaxParser : public CFX_Target { FX_WCHAR* m_pCurrentBlock; int32_t m_iIndexInBlock; int32_t m_iTextDataLength; - uint32_t m_dwStatus; - uint32_t m_dwMode; + FDE_XmlSyntaxResult m_syntaxParserResult; + FDE_XmlSyntaxState m_syntaxParserState; FX_WCHAR m_wQuotationMark; int32_t m_iEntityStart; CFX_DWordStack m_SkipStack; |