OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_FXCRT_XML_INT_H_ | 7 #ifndef CORE_FXCRT_XML_INT_H_ |
8 #define CORE_FXCRT_XML_INT_H_ | 8 #define CORE_FXCRT_XML_INT_H_ |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 uint8_t* m_pBuffer; | 55 uint8_t* m_pBuffer; |
56 FX_FILESIZE m_nStart; | 56 FX_FILESIZE m_nStart; |
57 size_t m_dwSize; | 57 size_t m_dwSize; |
58 }; | 58 }; |
59 | 59 |
60 class CXML_Parser { | 60 class CXML_Parser { |
61 public: | 61 public: |
62 CXML_Parser(); | 62 CXML_Parser(); |
63 ~CXML_Parser(); | 63 ~CXML_Parser(); |
64 | 64 |
65 FX_BOOL Init(uint8_t* pBuffer, size_t size); | 65 bool Init(uint8_t* pBuffer, size_t size); |
66 FX_BOOL Init(IFX_SeekableReadStream* pFileRead); | 66 bool Init(IFX_SeekableReadStream* pFileRead); |
67 FX_BOOL Init(IFX_BufferRead* pBuffer); | 67 bool Init(IFX_BufferRead* pBuffer); |
68 FX_BOOL Init(FX_BOOL bOwndedStream); | 68 bool Init(bool bOwndedStream); |
69 FX_BOOL ReadNextBlock(); | 69 bool ReadNextBlock(); |
70 FX_BOOL IsEOF(); | 70 bool IsEOF(); |
71 FX_BOOL HaveAvailData(); | 71 bool HaveAvailData(); |
72 void SkipWhiteSpaces(); | 72 void SkipWhiteSpaces(); |
73 void GetName(CFX_ByteString& space, CFX_ByteString& name); | 73 void GetName(CFX_ByteString& space, CFX_ByteString& name); |
74 void GetAttrValue(CFX_WideString& value); | 74 void GetAttrValue(CFX_WideString& value); |
75 uint32_t GetCharRef(); | 75 uint32_t GetCharRef(); |
76 void GetTagName(CFX_ByteString& space, | 76 void GetTagName(CFX_ByteString& space, |
77 CFX_ByteString& name, | 77 CFX_ByteString& name, |
78 FX_BOOL& bEndTag, | 78 FX_BOOL& bEndTag, |
79 FX_BOOL bStartTag = FALSE); | 79 FX_BOOL bStartTag = FALSE); |
80 void SkipLiterals(const CFX_ByteStringC& str); | 80 void SkipLiterals(const CFX_ByteStringC& str); |
81 CXML_Element* ParseElement(CXML_Element* pParent, FX_BOOL bStartTag = FALSE); | 81 CXML_Element* ParseElement(CXML_Element* pParent, FX_BOOL bStartTag = FALSE); |
82 void InsertContentSegment(FX_BOOL bCDATA, | 82 void InsertContentSegment(FX_BOOL bCDATA, |
83 const CFX_WideStringC& content, | 83 const CFX_WideStringC& content, |
84 CXML_Element* pElement); | 84 CXML_Element* pElement); |
85 void InsertCDATASegment(CFX_UTF8Decoder& decoder, CXML_Element* pElement); | 85 void InsertCDATASegment(CFX_UTF8Decoder& decoder, CXML_Element* pElement); |
86 | 86 |
87 IFX_BufferRead* m_pDataAcc; | 87 IFX_BufferRead* m_pDataAcc; |
88 FX_BOOL m_bOwnedStream; | 88 bool m_bOwnedStream; |
89 FX_FILESIZE m_nOffset; | 89 FX_FILESIZE m_nOffset; |
90 FX_BOOL m_bSaveSpaceChars; | 90 FX_BOOL m_bSaveSpaceChars; |
91 const uint8_t* m_pBuffer; | 91 const uint8_t* m_pBuffer; |
92 size_t m_dwBufferSize; | 92 size_t m_dwBufferSize; |
93 FX_FILESIZE m_nBufferOffset; | 93 FX_FILESIZE m_nBufferOffset; |
94 size_t m_dwIndex; | 94 size_t m_dwIndex; |
95 }; | 95 }; |
96 | 96 |
97 void FX_XML_SplitQualifiedName(const CFX_ByteStringC& bsFullName, | 97 void FX_XML_SplitQualifiedName(const CFX_ByteStringC& bsFullName, |
98 CFX_ByteStringC& bsSpace, | 98 CFX_ByteStringC& bsSpace, |
99 CFX_ByteStringC& bsName); | 99 CFX_ByteStringC& bsName); |
100 | 100 |
101 #endif // CORE_FXCRT_XML_INT_H_ | 101 #endif // CORE_FXCRT_XML_INT_H_ |
OLD | NEW |