• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2017 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 CORE_FXCRT_XML_CXML_DATABUFACC_H_
8 #define CORE_FXCRT_XML_CXML_DATABUFACC_H_
9 
10 #include "core/fxcrt/fx_system.h"
11 
12 class CXML_DataBufAcc {
13  public:
14   CXML_DataBufAcc(const uint8_t* pBuffer, size_t size);
15   ~CXML_DataBufAcc();
16 
IsEOF()17   bool IsEOF() const { return m_dwCurPos >= m_dwSize; }
GetPosition()18   FX_FILESIZE GetPosition() const {
19     return static_cast<FX_FILESIZE>(m_dwCurPos);
20   }
21   bool ReadNextBlock();
GetBlockBuffer()22   const uint8_t* GetBlockBuffer() const { return m_pBuffer; }
GetBlockSize()23   size_t GetBlockSize() const { return m_dwSize; }
24 
25  private:
26   const uint8_t* m_pBuffer;
27   size_t m_dwSize;
28   size_t m_dwCurPos;
29 };
30 
31 #endif  // CORE_FXCRT_XML_CXML_DATABUFACC_H_
32