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

Side by Side Diff: xfa/fxfa/parser/cxfa_document_parser.cpp

Issue 2129963002: Break xfa_parser_imp apart (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@ixfa_parser
Patch Set: Rebase to master Created 4 years, 5 months 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 | « xfa/fxfa/parser/cxfa_document_parser.h ('k') | xfa/fxfa/parser/cxfa_simple_parser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #include "xfa/fxfa/parser/cxfa_document_parser.h"
8
9 #include "xfa/fxfa/include/fxfa.h"
10 #include "xfa/fxfa/parser/xfa_document.h"
11
12 CXFA_DocumentParser::CXFA_DocumentParser(CXFA_FFNotify* pNotify)
13 : m_nodeParser(nullptr, TRUE), m_pNotify(pNotify) {}
14
15 CXFA_DocumentParser::~CXFA_DocumentParser() {
16 CloseParser();
17 }
18
19 int32_t CXFA_DocumentParser::StartParse(IFX_FileRead* pStream,
20 XFA_XDPPACKET ePacketID) {
21 CloseParser();
22 int32_t nRetStatus = m_nodeParser.StartParse(pStream, ePacketID);
23 if (nRetStatus == XFA_PARSESTATUS_Ready) {
24 m_pDocument.reset(new CXFA_Document(this));
25 m_nodeParser.SetFactory(m_pDocument.get());
26 }
27 return nRetStatus;
28 }
29
30 int32_t CXFA_DocumentParser::DoParse(IFX_Pause* pPause) {
31 int32_t nRetStatus = m_nodeParser.DoParse(pPause);
32 if (nRetStatus >= XFA_PARSESTATUS_Done) {
33 ASSERT(m_pDocument);
34 m_pDocument->SetRoot(m_nodeParser.GetRootNode());
35 }
36 return nRetStatus;
37 }
38
39 CFDE_XMLDoc* CXFA_DocumentParser::GetXMLDoc() const {
40 return m_nodeParser.GetXMLDoc();
41 }
42
43 CXFA_FFNotify* CXFA_DocumentParser::GetNotify() const {
44 return m_pNotify;
45 }
46
47 CXFA_Document* CXFA_DocumentParser::GetDocument() const {
48 return m_pDocument.get();
49 }
50
51 void CXFA_DocumentParser::CloseParser() {
52 m_pDocument.reset();
53 m_nodeParser.CloseParser();
54 }
OLDNEW
« no previous file with comments | « xfa/fxfa/parser/cxfa_document_parser.h ('k') | xfa/fxfa/parser/cxfa_simple_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698