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

Side by Side Diff: xfa/include/fxfa/xfa_checksum.h

Issue 1864973005: Move remaining xfa/include/fxfa files (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 8 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/include/fxfa/fxfa_widget.h ('k') | xfa/include/fxfa/xfa_ffapp.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 2014 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 #ifndef XFA_INCLUDE_FXFA_XFA_CHECKSUM_H_
8 #define XFA_INCLUDE_FXFA_XFA_CHECKSUM_H_
9
10 #include "xfa/fgas/xml/fgas_sax.h"
11 #include "xfa/include/fxfa/fxfa.h"
12
13 class CXFA_SAXReaderHandler;
14 class CXFA_ChecksumContext;
15
16 class CXFA_SAXContext {
17 public:
18 CXFA_SAXContext() : m_eNode(FX_SAXNODE_Unknown) {}
19 CFX_ByteTextBuf m_TextBuf;
20 CFX_ByteString m_bsTagName;
21 FX_SAXNODE m_eNode;
22 };
23 class CXFA_SAXReaderHandler : public IFX_SAXReaderHandler {
24 public:
25 CXFA_SAXReaderHandler(CXFA_ChecksumContext* pContext);
26 virtual ~CXFA_SAXReaderHandler();
27 virtual void* OnTagEnter(const CFX_ByteStringC& bsTagName,
28 FX_SAXNODE eType,
29 uint32_t dwStartPos);
30 virtual void OnTagAttribute(void* pTag,
31 const CFX_ByteStringC& bsAttri,
32 const CFX_ByteStringC& bsValue);
33 virtual void OnTagBreak(void* pTag);
34 virtual void OnTagData(void* pTag,
35 FX_SAXNODE eType,
36 const CFX_ByteStringC& bsData,
37 uint32_t dwStartPos);
38 virtual void OnTagClose(void* pTag, uint32_t dwEndPos);
39 virtual void OnTagEnd(void* pTag,
40 const CFX_ByteStringC& bsTagName,
41 uint32_t dwEndPos);
42
43 virtual void OnTargetData(void* pTag,
44 FX_SAXNODE eType,
45 const CFX_ByteStringC& bsData,
46 uint32_t dwStartPos);
47
48 protected:
49 void UpdateChecksum(FX_BOOL bCheckSpace);
50 CXFA_ChecksumContext* m_pContext;
51 CXFA_SAXContext m_SAXContext;
52 };
53
54 class CXFA_ChecksumContext {
55 public:
56 CXFA_ChecksumContext();
57 ~CXFA_ChecksumContext();
58
59 void Release() { delete this; }
60 FX_BOOL StartChecksum();
61 FX_BOOL UpdateChecksum(IFX_FileRead* pSrcFile,
62 FX_FILESIZE offset = 0,
63 size_t size = 0);
64 void FinishChecksum();
65 void GetChecksum(CFX_ByteString& bsChecksum);
66 void Update(const CFX_ByteStringC& bsText);
67
68 protected:
69 IFX_SAXReader* m_pSAXReader;
70 uint8_t* m_pByteContext;
71 CFX_ByteString m_bsChecksum;
72 };
73
74 #endif // XFA_INCLUDE_FXFA_XFA_CHECKSUM_H_
OLDNEW
« no previous file with comments | « xfa/include/fxfa/fxfa_widget.h ('k') | xfa/include/fxfa/xfa_ffapp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698