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 _FXCRT_XML_INT_ | 7 #ifndef _FXCRT_XML_INT_ |
8 #define _FXCRT_XML_INT_ | 8 #define _FXCRT_XML_INT_ |
9 class CXML_DataBufAcc : public IFX_BufferRead | 9 class CXML_DataBufAcc : public IFX_BufferRead |
10 { | 10 { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 m_nStart = 0; | 100 m_nStart = 0; |
101 } | 101 } |
102 FX_FILESIZE nLength = m_pFileRead->GetSize(); | 102 FX_FILESIZE nLength = m_pFileRead->GetSize(); |
103 m_nStart += (FX_FILESIZE)m_dwSize; | 103 m_nStart += (FX_FILESIZE)m_dwSize; |
104 if (m_nStart >= nLength) { | 104 if (m_nStart >= nLength) { |
105 return FALSE; | 105 return FALSE; |
106 } | 106 } |
107 m_dwSize = (size_t)FX_MIN(FX_XMLDATASTREAM_BufferSize, nLength - m_nStar
t); | 107 m_dwSize = (size_t)FX_MIN(FX_XMLDATASTREAM_BufferSize, nLength - m_nStar
t); |
108 if (!m_pBuffer) { | 108 if (!m_pBuffer) { |
109 m_pBuffer = FX_Alloc(FX_BYTE, m_dwSize); | 109 m_pBuffer = FX_Alloc(FX_BYTE, m_dwSize); |
110 if (!m_pBuffer) { | |
111 return FALSE; | |
112 } | |
113 } | 110 } |
114 return m_pFileRead->ReadBlock(m_pBuffer, m_nStart, m_dwSize); | 111 return m_pFileRead->ReadBlock(m_pBuffer, m_nStart, m_dwSize); |
115 } | 112 } |
116 virtual FX_LPCBYTE GetBlockBuffer() | 113 virtual FX_LPCBYTE GetBlockBuffer() |
117 { | 114 { |
118 return (FX_LPCBYTE)m_pBuffer; | 115 return (FX_LPCBYTE)m_pBuffer; |
119 } | 116 } |
120 virtual size_t GetBlockSize() | 117 virtual size_t GetBlockSize() |
121 { | 118 { |
122 return m_dwSize; | 119 return m_dwSize; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 void GetAttrValue(CFX_WideString &value); | 152 void GetAttrValue(CFX_WideString &value); |
156 FX_DWORD GetCharRef(); | 153 FX_DWORD GetCharRef(); |
157 void GetTagName(CFX_ByteString &space, CFX_ByteString
&name, FX_BOOL &bEndTag, FX_BOOL bStartTag = FALSE); | 154 void GetTagName(CFX_ByteString &space, CFX_ByteString
&name, FX_BOOL &bEndTag, FX_BOOL bStartTag = FALSE); |
158 void SkipLiterals(FX_BSTR str); | 155 void SkipLiterals(FX_BSTR str); |
159 CXML_Element* ParseElement(CXML_Element* pParent, FX_BOOL bStartTag =
FALSE); | 156 CXML_Element* ParseElement(CXML_Element* pParent, FX_BOOL bStartTag =
FALSE); |
160 void InsertContentSegment(FX_BOOL bCDATA, FX_WSTR con
tent, CXML_Element* pElement); | 157 void InsertContentSegment(FX_BOOL bCDATA, FX_WSTR con
tent, CXML_Element* pElement); |
161 void InsertCDATASegment(CFX_UTF8Decoder& decoder, CXM
L_Element* pElement); | 158 void InsertCDATASegment(CFX_UTF8Decoder& decoder, CXM
L_Element* pElement); |
162 }; | 159 }; |
163 void FX_XML_SplitQualifiedName(FX_BSTR bsFullName, CFX_ByteStringC &bsSpace, CFX
_ByteStringC &bsName); | 160 void FX_XML_SplitQualifiedName(FX_BSTR bsFullName, CFX_ByteStringC &bsSpace, CFX
_ByteStringC &bsName); |
164 #endif | 161 #endif |
OLD | NEW |