Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: core/fxcrt/fx_xml_parser.cpp

Issue 2443723002: Rename IFX_ stream names (Closed)
Patch Set: Nits Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fxcrt/fx_xml.h ('k') | core/fxcrt/fxcrt_stream.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "core/fxcrt/xml_int.h" 7 #include "core/fxcrt/xml_int.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } 50 }
51 51
52 size_t CXML_DataBufAcc::GetBlockSize() { 52 size_t CXML_DataBufAcc::GetBlockSize() {
53 return m_dwSize; 53 return m_dwSize;
54 } 54 }
55 55
56 FX_FILESIZE CXML_DataBufAcc::GetBlockOffset() { 56 FX_FILESIZE CXML_DataBufAcc::GetBlockOffset() {
57 return 0; 57 return 0;
58 } 58 }
59 59
60 CXML_DataStmAcc::CXML_DataStmAcc(IFX_FileRead* pFileRead) 60 CXML_DataStmAcc::CXML_DataStmAcc(IFX_SeekableReadStream* pFileRead)
61 : m_pFileRead(pFileRead), m_pBuffer(nullptr), m_nStart(0), m_dwSize(0) { 61 : m_pFileRead(pFileRead), m_pBuffer(nullptr), m_nStart(0), m_dwSize(0) {
62 ASSERT(m_pFileRead); 62 ASSERT(m_pFileRead);
63 } 63 }
64 64
65 CXML_DataStmAcc::~CXML_DataStmAcc() { 65 CXML_DataStmAcc::~CXML_DataStmAcc() {
66 FX_Free(m_pBuffer); 66 FX_Free(m_pBuffer);
67 } 67 }
68 68
69 void CXML_DataStmAcc::Release() { 69 void CXML_DataStmAcc::Release() {
70 delete this; 70 delete this;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 CXML_Parser::~CXML_Parser() { 125 CXML_Parser::~CXML_Parser() {
126 if (m_bOwnedStream) { 126 if (m_bOwnedStream) {
127 m_pDataAcc->Release(); 127 m_pDataAcc->Release();
128 } 128 }
129 } 129 }
130 130
131 FX_BOOL CXML_Parser::Init(uint8_t* pBuffer, size_t size) { 131 FX_BOOL CXML_Parser::Init(uint8_t* pBuffer, size_t size) {
132 m_pDataAcc = new CXML_DataBufAcc(pBuffer, size); 132 m_pDataAcc = new CXML_DataBufAcc(pBuffer, size);
133 return Init(TRUE); 133 return Init(TRUE);
134 } 134 }
135 FX_BOOL CXML_Parser::Init(IFX_FileRead* pFileRead) { 135 FX_BOOL CXML_Parser::Init(IFX_SeekableReadStream* pFileRead) {
136 m_pDataAcc = new CXML_DataStmAcc(pFileRead); 136 m_pDataAcc = new CXML_DataStmAcc(pFileRead);
137 return Init(TRUE); 137 return Init(TRUE);
138 } 138 }
139 FX_BOOL CXML_Parser::Init(IFX_BufferRead* pBuffer) { 139 FX_BOOL CXML_Parser::Init(IFX_BufferRead* pBuffer) {
140 if (!pBuffer) { 140 if (!pBuffer) {
141 return FALSE; 141 return FALSE;
142 } 142 }
143 m_pDataAcc = pBuffer; 143 m_pDataAcc = pBuffer;
144 return Init(FALSE); 144 return Init(FALSE);
145 } 145 }
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 CXML_Element* CXML_Element::Parse(const void* pBuffer, 644 CXML_Element* CXML_Element::Parse(const void* pBuffer,
645 size_t size, 645 size_t size,
646 FX_BOOL bSaveSpaceChars, 646 FX_BOOL bSaveSpaceChars,
647 FX_FILESIZE* pParsedSize) { 647 FX_FILESIZE* pParsedSize) {
648 CXML_Parser parser; 648 CXML_Parser parser;
649 if (!parser.Init((uint8_t*)pBuffer, size)) { 649 if (!parser.Init((uint8_t*)pBuffer, size)) {
650 return nullptr; 650 return nullptr;
651 } 651 }
652 return XML_ContinueParse(parser, bSaveSpaceChars, pParsedSize); 652 return XML_ContinueParse(parser, bSaveSpaceChars, pParsedSize);
653 } 653 }
654 CXML_Element* CXML_Element::Parse(IFX_FileRead* pFile, 654 CXML_Element* CXML_Element::Parse(IFX_SeekableReadStream* pFile,
655 FX_BOOL bSaveSpaceChars, 655 FX_BOOL bSaveSpaceChars,
656 FX_FILESIZE* pParsedSize) { 656 FX_FILESIZE* pParsedSize) {
657 CXML_Parser parser; 657 CXML_Parser parser;
658 if (!parser.Init(pFile)) { 658 if (!parser.Init(pFile)) {
659 return nullptr; 659 return nullptr;
660 } 660 }
661 return XML_ContinueParse(parser, bSaveSpaceChars, pParsedSize); 661 return XML_ContinueParse(parser, bSaveSpaceChars, pParsedSize);
662 } 662 }
663 CXML_Element* CXML_Element::Parse(IFX_BufferRead* pBuffer, 663 CXML_Element* CXML_Element::Parse(IFX_BufferRead* pBuffer,
664 FX_BOOL bSaveSpaceChars, 664 FX_BOOL bSaveSpaceChars,
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 m_pMap->push_back({space, name, CFX_WideString(value)}); 907 m_pMap->push_back({space, name, CFX_WideString(value)});
908 } 908 }
909 909
910 int CXML_AttrMap::GetSize() const { 910 int CXML_AttrMap::GetSize() const {
911 return m_pMap ? pdfium::CollectionSize<int>(*m_pMap) : 0; 911 return m_pMap ? pdfium::CollectionSize<int>(*m_pMap) : 0;
912 } 912 }
913 913
914 CXML_AttrItem& CXML_AttrMap::GetAt(int index) const { 914 CXML_AttrItem& CXML_AttrMap::GetAt(int index) const {
915 return (*m_pMap)[index]; 915 return (*m_pMap)[index];
916 } 916 }
OLDNEW
« no previous file with comments | « core/fxcrt/fx_xml.h ('k') | core/fxcrt/fxcrt_stream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698